Repository navigation
Refs CVE-2026-48587 -- Added helper to properly split header values. - #21438
Merged
Merged
Conversation
jacobtylerwalls
approved these changes
Jun 8, 2026
jacobtylerwalls
left a comment
Member
There was a problem hiding this comment.
Thanks, this looks great.
Extracted the repeated `split(",")` + per-token `.strip()` pattern into
a `split_header_value()` generator in django/utils/http.py. The previous
`cc_delim_re` regex only stripped whitespace adjacent to the comma
delimiter, leaving leading or trailing whitespace on the first and last
tokens. Now, `split_header_value()` strips every token fully, matching
RFC 9110's optional-whitespace rules.
Thanks to Shai Berger, Jacob Walls, and Sarah Boyce for reviews.
nessita
force-pushed
the
follow-up-CVE-2026-48587
branch
from
June 8, 2026 20:34
2642bb0 to
5a19927
Compare
laymonage
reviewed
Jun 9, 2026
| from django.utils.timezone import get_current_timezone_name | ||
| from django.utils.translation import get_language | ||
|
|
||
| cc_delim_re = _lazy_re_compile(r"\s*,\s*") |
Member
There was a problem hiding this comment.
Hi @nessita @jacobtylerwalls, just a heads-up. The removal of this expression might warrant a mention in the release notes. It's used by DRF at the moment, which would break until they fix it.
Contributor
Author
There was a problem hiding this comment.
Thank you @laymonage for raising this, but Django does not guarantee backwards compatibility for private symbols, and cc_delim_re was a private, undocumented implementation detail. It was never part of the public API and did not appear in the documentation. Third-party code relying on private internals should expect breakage across releases, we can't possibly document every internal refactoring.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trac ticket number
CVE-2026-48587
Branch description
Extracted the repeated
split(",")+ per-token.strip()pattern into asplit_header_value()generator in django/utils/http.py. The previouscc_delim_reregex only stripped whitespace adjacent to the comma delimiter, leaving leading or trailing whitespace on the first and last tokens. Now,split_header_value()strips every token fully, matching RFC 9110's optional-whitespace rules.AI Assistance Disclosure (REQUIRED)
Claude code was used to review the changes as a whole to ensure consistency and no missing spots.
Checklist
mainbranch.