fix(client): send credentials only to the configured jira origin - #7
Merged
Conversation
download_attachment_bytes previously used absolute attachment content URLs from Jira responses verbatim, sending the caller's Basic/Bearer credentials to whatever host the metadata named. Absolute URLs are now accepted only when their origin (scheme + host + port) matches the configured base URL; anything else is refused fail-closed with a generic error before any request is made. Touches I12 (spirit: token custody) and I1.
plusky
enabled auto-merge (rebase)
August 8, 2026 19:44
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.
JiraClient::download_attachment_bytesused an absolutecontentURL from Jira's attachment metadata verbatim and attached the caller's credentials (Basic or Bearer) with no host check — and acceptedhttp://. A compromised or misconfigured Jira instance could therefore exfiltrate the operator's API token to an arbitrary third-party host, potentially in cleartext. Everywhere else the base URL is authoritative; this was the one place attacker-influenceable data chose the request target.Absolute content URLs must now match the configured base URL's origin (scheme + host + port); anything else is refused with a generic error that reveals nothing about issue or attachment existence. Relative URLs keep resolving against
base_url.http://remains possible only when the operator's own--jira-serveris http.Deviation from the finding: the optional
global.attachment_hostspolicy allowlist is deferred; the rule is strictly same-origin until a real deployment needs more.Invariants: I12 (token custody, in spirit), I1 (no client-influenceable trust added), I2 (refusal text is generic).
Tests: wiremock test with a second mock server proving no request — and hence no
Authorizationheader — ever reaches a foreign host; confirmed to fail against the unfixed code.Process: AI-assisted — implemented and independently adversarially reviewed against
docs/DESIGN.md(verdict: approve, with an empirical pre-fix-failure check). Full verification suite green at the commit.