Skip to content

Python: Model extra_response_headers - #22734

Open
tausbn wants to merge 1 commit into
mainfrom
tausbn/python315-model-extra-response-headers
Open

tausbn wants to merge 1 commit into
mainfrom
tausbn/python315-model-extra-response-headers

Conversation

@tausbn

@tausbn tausbn commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

This is a field that is (now) available on instances of SimpleHTTPRequestHandler, and which is vulnerable to a header injection attack.

This is a field that is (now) available on instances of
`SimpleHTTPRequestHandler`, and which is vulnerable to a header
injection attack.
@tausbn
tausbn marked this pull request as ready for review October 2, 2026 12:44
@tausbn
tausbn requested a review from a team as a code owner October 2, 2026 12:44
Copilot AI balanced review requested due to automatic review settings October 2, 2026 12:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

In-place mutations of the header mapping are not modeled, causing missed injection results.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Models Python 3.15 SimpleHTTPRequestHandler.extra_response_headers as a response-header sink.

Changes:

  • Models constructor and attribute assignments.
  • Adds framework and header-injection tests.
  • Adds a change note.
File Description
Stdlib.qll Adds header-write modeling.
test_extra_response_headers.py Tests framework concepts.
extra_response_headers.py Adds injection scenarios.
HeaderInjection.expected Updates generated expectations.
2026-09-22-python315-http-headers.md Documents the analysis improvement.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread python/ql/lib/semmle/python/frameworks/Stdlib.qll

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants