Skip to content

fix: detect X-Forwarded-Proto case-insensitively in isSecure() - #10627

Open
gr8man wants to merge 1 commit into
codeigniter4:developfrom
gr8man:fix/issecure-forwarded-proto-case
Open

gr8man wants to merge 1 commit into
codeigniter4:developfrom
gr8man:fix/issecure-forwarded-proto-case

Conversation

@gr8man

@gr8man gr8man commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Description
Fixed IncomingRequest::isSecure() not recognizing a trusted proxy's X-Forwarded-Proto: HTTPS value because the comparison was case-sensitive. Ambiguous multi-valued headers are now ignored, as they cannot be trusted.

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

IncomingRequest::isSecure() compared the trusted proxy's X-Forwarded-Proto value with a case-sensitive === 'https', so a proxy sending 'HTTPS' was not recognized as secure. The comparison is now case-insensitive and ignores ambiguous multi-valued headers, which cannot be trusted.
@carson-codeigniter4 carson-codeigniter4 Bot added bug Verified issues on the current code behavior or pull requests that will fix them needs template Opened issues not following the bug form template labels Oct 12, 2026
@carson-codeigniter4

Copy link
Copy Markdown

Hi there, @gr8man! 👋

It looks like this pull request does not follow our template:

  • Keep the Description heading from the pull request template and explain what you have changed, and why.

Please update the description to follow the template. The needs template label will be removed automatically once it does.

@carson-codeigniter4 carson-codeigniter4 Bot removed the needs template Opened issues not following the bug form template label Oct 12, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant