Skip to content

fix(HTTP): strip CRLF from DownloadResponse filename to prevent header injection - #10533

Open
gr8man wants to merge 1 commit into
codeigniter4:developfrom
gr8man:fix/download-response-crlf
Open

fix(HTTP): strip CRLF from DownloadResponse filename to prevent header injection#10533
gr8man wants to merge 1 commit into
codeigniter4:developfrom
gr8man:fix/download-response-crlf

Conversation

@gr8man

@gr8man gr8man commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Description
In DownloadResponse, filenames with carriage return (\r) or newline (\n) characters could cause RFC 7230 header validation errors or lead to HTTP header injection / response splitting.

This PR strips \r and \n characters from the filename when setting it on DownloadResponse.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

…r injection

Sanitize carriage return and newline characters from filename in DownloadResponse to prevent HTTP response splitting and invalid header values per RFC 7230.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant