Skip to content

Provide inline documentation/explanations for common false positive security reports - #7899

Draft
legoktm wants to merge 5 commits into
developfrom
bugcrowd-rejects
Draft

Provide inline documentation/explanations for common false positive security reports#7899
legoktm wants to merge 5 commits into
developfrom
bugcrowd-rejects

Conversation

@legoktm

@legoktm legoktm commented Aug 3, 2026

Copy link
Copy Markdown
Member

To attempt to head off some common security bug reports we get that aren't actually security issues or are already known.

Some commits have a bit more detail in the commit message.

Test plan

  • rationales make sense

Checklist

This change accounts for:

  • any required additional documentation
  • any necessary AppArmor changes (added or removed application files)
  • any impact on new SecureDrop installs and upgrades
  • our dependency update policy

@legoktm
legoktm requested a review from a team as a code owner August 3, 2026 16:55
@legoktm legoktm moved this to Ready For Review in SecureDrop Aug 3, 2026
@legoktm
legoktm requested a review from Copilot August 3, 2026 16:58

Copilot AI 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.

🟡 Not ready to approve

Several added “security rationale” comments are misleading/overstated (and one contains a grammar error), so the documentation should be corrected to avoid institutionalizing inaccurate security guidance.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR adds inline rationale comments across the SecureDrop codebase to preempt recurring false-positive security reports by documenting why certain patterns are intentional and what their security implications are.

Changes:

  • Adds clarification comments around “lightweight” PGP header checks for pre-encrypted replies.
  • Documents known session-cookie confidentiality limitations and links to the tracked issue.
  • Adds security rationale comments around 2FA verification ordering, 2FA-token logging, and “unscoped” UUID lookups in the journalist API.
File summaries
File Description
securedrop/store.py Adds rationale that the PGP armor check is only an API-misuse guard, not full OpenPGP validation.
securedrop/source_app/session_manager.py Documents that Flask session cookie contents are not encrypted and links to the existing tracking issue.
securedrop/models.py Adds rationale for verifying 2FA before password to enforce single-use OTP behavior.
securedrop/journalist_app/main.py Adds rationale for logging the 2FA token during login.
securedrop/journalist_app/api.py Adds rationales explaining why certain UUID relationships aren’t validated and why that’s not considered IDOR in this app.
Review details

Suppressed comments (3)

securedrop/journalist_app/api.py:189

  • Using "XXX" for this rationale reads like a temporary hack; elsewhere in the codebase similar security rationales use "NOTE". Also, the comment can be slightly more precise by stating that there is no object-level ACL among journalists.
        # XXX: even though we don't validate reply_uuid belongs to source_uuid, there's
        # no IDOR here because all journalists can see all sources/replies

securedrop/journalist_app/api.py:201

  • The new comment uses "see+delete", which is harder to read than "view and delete", and "XXX" is inconsistent with existing security notes (typically "NOTE"). Consider rewording for clarity and to match the established style.
        # XXX: even though we don't validate submission_uuid belongs to source_uuid, there's
        # no IDOR here because all journalists can see+delete all sources/submissions

securedrop/journalist_app/api.py:260

  • Using "XXX" for this rationale reads like a temporary hack; elsewhere in the codebase similar security rationales use "NOTE". Also, the comment can be slightly more precise by stating that there is no object-level ACL among journalists.
        # XXX: even though we don't validate reply_uuid belongs to source_uuid, there's
        # no IDOR here because all journalists can see all sources/replies
  • Files reviewed: 5/5 changed files
  • Comments generated: 3
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

Comment thread securedrop/journalist_app/main.py Outdated
Comment thread securedrop/models.py
Comment thread securedrop/journalist_app/api.py Outdated
legoktm added 5 commits August 3, 2026 13:18
We reguarly get reports that these routes don't validate the
submission_uuid/reply_uuid belongs to the corresponding source_uuid, but
there's no IDOR because all journalists can see and delete all
submissions and replies.

In an ideal world we'd drop the source_uuid from these endpoints
entirely as it's not necessary but it's not worth the breaking change.
This goes back to #786 / 8513cba (2014), in which 2FA token reuse was
blocked, which required checking 2FA before the password.
Mostly flagging this is a known issue that should not be re-reported to
us in hopes of a bounty.
@legoktm legoktm moved this from Ready For Review to Blocked or Waiting in SecureDrop Aug 3, 2026
@legoktm
legoktm marked this pull request as draft August 3, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Blocked or Waiting

Development

Successfully merging this pull request may close these issues.

2 participants