Skip to content

πŸ›‘οΈ Sentinel: [MEDIUM] Add Referrer-Policy security header - #273

Closed
dieterolson wants to merge 2 commits into
mainfrom
sentinel-add-referrer-policy-14293462493016191517
Closed

dieterolson wants to merge 2 commits into
mainfrom
sentinel-add-referrer-policy-14293462493016191517

Conversation

@dieterolson

Copy link
Copy Markdown
Contributor

🚨 Severity: MEDIUM
πŸ’‘ Vulnerability: The local FastAPI server lacked a Referrer-Policy header, potentially allowing sensitive local application URLs or state to leak to external domains via the Referer header when making outbound requests.
🎯 Impact: Minor information exposure regarding local development environments or sensitive paths.
πŸ”§ Fix: Explicitly set Referrer-Policy: no-referrer in the add_security_headers middleware.
βœ… Verification: Ran unit tests and verified linting passes.


PR created automatically by Jules for task 14293462493016191517 started by @dieterolson

Added `Referrer-Policy: no-referrer` to the FastAPI application's security headers middleware to prevent leakage of sensitive local URLs or state to external domains.

Co-authored-by: dieterolson <198168927+dieterolson@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
πŸ“ Code Review βœ… Completed 2026-09-18T05:30:54.221802Z ce570ea PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with πŸ‘€ while any review is running, comments if it has suggestions, and reacts with πŸ‘ once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

⚠️ SPEC.md Update Required

Source files were modified in this PR but SPEC.md was not updated.

Per the Specification-Driven Development Policy:

  • Any PR that adds, removes, or changes functionality must update SPEC.md
  • Update the relevant sections (features, architecture, tests, dependencies, etc.)
  • Bump the Spec Version if making substantive changes

To resolve:

  1. Update SPEC.md to reflect your changes, OR
  2. Add the spec-exempt label if this PR genuinely doesn't affect the spec (e.g., pure refactor with no behavior change)

This check is enforced by the spec-check CI workflow.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce570eaa95

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

response.headers["Strict-Transport-Security"] = (
"max-age=31536000; includeSubDomains"
)
response.headers["Referrer-Policy"] = "no-referrer"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add a regression assertion for Referrer-Policy

The commit adds a new response-header contract but changes no test to assert Referrer-Policy: no-referrer; as a result, later middleware reordering or removal could silently undo the intended protection while the current API suite remains green. Add a request-level regression test covering this header as required by the repository's test-first policy.

AGENTS.md reference: AGENTS.md:L175-L177

Useful? React with πŸ‘Β / πŸ‘Ž.

response.headers["Strict-Transport-Security"] = (
"max-age=31536000; includeSubDomains"
)
response.headers["Referrer-Policy"] = "no-referrer"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Update the canonical handoff with this implementation

This implementation commit neither adds nor updates the canonical handoff, leaving its changed files, validation evidence, and continuation state unavailable to the next agent. The Sentinel note is not a substitute for the required same-commit handoff update; create or refresh the canonical handoff, or record the prescribed no-material-change entry.

AGENTS.md reference: AGENTS.md:L271-L275

Useful? React with πŸ‘Β / πŸ‘Ž.

response.headers["Strict-Transport-Security"] = (
"max-age=31536000; includeSubDomains"
)
response.headers["Referrer-Policy"] = "no-referrer"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Register this implementation in the development log

The commit changes src/bitnet_launcher/api.py, but the canonical development log has no live entry for this security-header work, governing issue, or branch. That makes the implementation orphaned from the repository's state tracking; add or update the issue-keyed entry in the same change.

AGENTS.md reference: AGENTS.md:L336-L341

Useful? React with πŸ‘Β / πŸ‘Ž.

Added `Referrer-Policy: no-referrer` to the FastAPI application's security headers middleware to prevent leakage of sensitive local URLs or state to external domains.

Co-authored-by: dieterolson <198168927+dieterolson@users.noreply.github.com>
@dieterolson

Copy link
Copy Markdown
Contributor Author

Closing as redundant duplicate of #269 (merged into main). #269 implemented the Referrer-Policy: no-referrer header along with comprehensive unit tests.

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