Skip to content

feat(cli): construct-aware location validation #433

Closed

Description

@dan-petty

Context & Rationale

_check_line_boundaries invalidates a finding only when its line number exceeds the file length. A location that is in-bounds but points at unrelated code passes untouched, so a finding can describe a real defect while sending the reader — or an auto-fix stage — to the wrong construct. Observed: a genuine SSRF finding cited an HTML tag handler roughly 170 lines from the vulnerable function.

Scope & Deliverables

  • Context & Rationale*: _check_line_boundaries invalidates a finding only when its line number exceeds the file length. A location that is in-bounds but points at unrelated code passes untouched, so a finding can describe a real defect while sending the reader — or an auto-fix stage — to the wrong construct. Observed: a genuine SSRF finding cited an HTML tag handler roughly 170 lines from the vulnerable function.
  • Remediation*: After bounds checking, verify the cited span actually contains the construct the finding names (symbol, call, decorator, or literal) using the AST utilities already used by _check_missing_symbol_hallucination. On mismatch, attempt relocation by symbol search and record the correction; invalidate only when the construct is absent from the file entirely. Wrong-but-recoverable locations should be repaired, not discarded.

Strategic Alignment

  • Milestone: v0.2.23 (Foundational Architectural Guardrails & Project Hygiene)
  • Roadmap Reference: docs/ROADMAP.md

Activity

  1. added this to the v0.2.23 milestone on Sep 22, 2026
  2. added
    type/feature
    scope/cli
    priority/p1-high
    on Sep 22, 2026
  3. dan-petty commented on Sep 25, 2026

    @dan-petty
    OwnerAuthor

    Closed by #575, merged into release/v0.2.23.

    GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by devops gh issues close-merged.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/clitype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions