Skip to content

fix(deps): check the tools lock requirement files for advisories #3988

Closed

Description

@dan-petty

Problem

devops ci audit checks uv.lock and the Node lock files. It does not check the hashed requirement files of the tools lock. devops research advisories (#3898) found seven advisories on 2026-11-07 in src/devops_cli/tools_lock/semgrep.txt, and osv-scanner 2.6.0 reports the same ids for that file:

Semgrep runs in the review sandbox with no network, so the effect is limited, but the pins are old and no check shows them.

Expected

The pins of the requirement files of the tools lock have no known advisory, or each one that has no released fix has a time-limited ignore (SECURITY.md, "A Finding with No Fix"). A check fails when a requirement file of the tools lock holds an advisory, so the problem cannot return.

Acceptance criteria

  • src/devops_cli/tools_lock/semgrep.txt is compiled again from the pinned Semgrep version, and bandit.txt is checked too.
  • devops ci audit (or the check that runs it) reads the requirement files of the tools lock, for example with osv-scanner --lockfile requirements.txt:<file>, and fails on an advisory. A test shows that a requirement file with a pin that has an advisory fails the check.
  • If a newer Semgrep release is needed to take the fixed mcp and certifi, the issue names it and follows the two-week release rule.

Existing tool considered

osv-scanner 2.6.0 reads requirements.txt files with the --lockfile requirements.txt:<path> form (checked on 2026-11-07). devops research advisories (#3898) is a second way to find the same ids.

Related

Found by #3898. Related: devops ci audit, devops scan fix, #2013.

Proposed design

Problem statement

The audit checks uv.lock and the Node lock files. It does not check the hashed requirement files of the tools lock. Seven advisories affect pins in semgrep.txt, and no check shows them. Add osv-scanner coverage for every tools-lock requirement file and refresh the pins.

Acceptance criteria

Requirement: Tools lock files are regenerated

Each hashed requirement file in src/devops_cli/tools_lock/ SHALL be generated from the tool version pinned in the tools lock, not edited by hand.

Scenario: Semgrep and Bandit files are regenerated

  • WHEN the tools-lock compiler runs for the pinned Semgrep and Bandit versions
  • THEN src/devops_cli/tools_lock/semgrep.txt and src/devops_cli/tools_lock/bandit.txt match the compiler output

Requirement: Audit scans the tools lock

devops ci audit SHALL scan every requirement file under src/devops_cli/tools_lock/ with osv-scanner.

Scenario: Audit scans each requirement file

  • WHEN devops ci audit runs on a tools lock with semgrep.txt and bandit.txt
  • THEN the audit calls osv-scanner --lockfile requirements.txt:<file> for each file and reports each file scanned

Requirement: Audit fails on an advisory

devops ci audit SHALL fail when a requirement file of the tools lock holds a pin with a known advisory.

Scenario: A pin has an advisory

  • WHEN a requirement file under src/devops_cli/tools_lock/ contains a pin that osv-scanner reports with an advisory
  • THEN devops ci audit exits non-zero and names the file, package and advisory id

Requirement: Audit passes without an advisory

devops ci audit SHALL pass when osv-scanner reports no advisory for every requirement file of the tools lock.

Scenario: No advisory in the tools lock

  • WHEN osv-scanner reports no advisory for every requirement file under src/devops_cli/tools_lock/
  • THEN devops ci audit exits zero and reports each file scanned

Requirement: No-fix finding has a time-limited ignore

A finding with no released fix SHALL pass the audit only with a time-limited ignore that names the advisory, file, reason and expiry.

Scenario: An ignore has expired

  • WHEN osv-scanner reports a tools-lock advisory with no fixed version and its ignore expiry is before the run date
  • THEN devops ci audit exits non-zero and reports the expired ignore

Requirement: Semgrep release is named

If the pinned Semgrep version cannot take mcp 1.30.0 and certifi 2026.10.18, the change SHALL name the next Semgrep release that can or the upstream release that blocks it.

Scenario: Pinned Semgrep cannot take the fixed packages

  • WHEN the pinned Semgrep version cannot use mcp 1.30.0 and certifi 2026.10.18
  • THEN the proposal names the required Semgrep release and tasks.md records the two-week release wait

Existing Tool Considered

No alternatives check has run. osv-scanner 2.6.0 covers Python requirements.txt files with --lockfile requirements.txt:<path> and reports the same advisory ids. It lacks the tools-lock compiler, the pin updates and the time-limited ignore policy. devops ci audit must call it.

Key questions

  • Where should the tools-lock advisory check run?: Extend devops ci audit to scan every *.txt file under src/devops_cli/tools_lock/ with the existing osv-scanner adapter. The check runs in CI as a gate and fails on any advisory. (best practice) [sources: docs/adr/0004-ci-is-the-authoritative-gate.md, tests/security/test_osv_scanner.py]
    • Chosen: Extend devops ci audit. The audit is the existing CI gate and the osv-scanner adapter already parses advisories.
    • Rejected: Add a separate devops ci audit-tools-lock command. It adds a second entry point and a second CI job for the same need.
    • Rejected: Rely on devops research advisories. It is a research command, not a gate, and the pins went unseen.
  • Which tools-lock files must the check scan?: Scan every *.txt requirement file under src/devops_cli/tools_lock/, including semgrep.txt and bandit.txt. Discover the files from the directory so a new tool is covered without a code change. (best practice) [sources: src/devops_cli/tools_lock/semgrep.txt, src/devops_cli/tools_lock/bandit.txt]
    • Chosen: Directory scan of src/devops_cli/tools_lock/*.txt. It covers semgrep.txt, bandit.txt and future tools-lock files.
    • Rejected: Hard-coded list of semgrep.txt and bandit.txt. A new tool would need a code change and could be missed.
    • Rejected: Only semgrep.txt. The issue requires bandit.txt too.
  • How should the check call osv-scanner for a requirement file?: Call osv-scanner --lockfile requirements.txt:<file> for each file and parse the JSON output through the existing osv-scanner adapter. A non-zero exit with an advisory fails the audit. (best practice) [sources: tests/security/test_osv_scanner.py, docs/adr/0005-review-findings-come-from-tools-not-models.md]
    • Chosen: Reuse the osv-scanner adapter. The adapter already reads osv-scanner reports and the issue confirms the requirements.txt:<file> form.
    • Rejected: Use devops research advisories. It is a second path and not the CI gate.
    • Rejected: Parse requirements.txt and query OSV by hand. It rebuilds what osv-scanner already does.
  • How should a finding with no released fix be handled?: Accept only a time-limited ignore in the SECURITY.md "A Finding with No Fix" format, with the advisory id, file, reason and expiry. The audit fails when the expiry has passed. (best practice) [sources: SECURITY.md]
    • Chosen: Time-limited ignore with expiry. The issue allows it and the project policy requires a reason and an expiry.
    • Rejected: Fail until a fix exists. It blocks the audit for a long time and ignores the documented policy.
    • Rejected: Silently suppress the finding. It hides the advisory and breaks the audit's purpose.
  • How should semgrep.txt be regenerated?: Regenerate semgrep.txt with the repository's tools-lock compiler from the pinned Semgrep version. Do not edit the hashed file by hand. Regenerate bandit.txt in the same way. (best practice) [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md, src/devops_cli/tools_lock/semgrep.txt]
    • Chosen: Use the existing tools-lock compiler. The ADR requires hashed requirements and the file is generated, not hand-kept.
    • Rejected: Edit the pins and hashes by hand. It is error-prone and cannot reproduce the hashes.
    • Rejected: Leave the old file. It keeps the old pins and the advisories.
  • Which Semgrep version should the change pin?: Use the newest Semgrep release that can take mcp 1.30.0 and certifi 2026.10.18. If no release can, keep the current pin, add the time-limited ignore, and name the blocking Semgrep release. (best practice) [sources: src/devops_cli/tools_lock/semgrep.txt]
    • Chosen: Newest Semgrep that takes both fixed packages. It clears the two fixed advisories without an ignore.
    • Rejected: Keep the current pin and ignore. Use it only when no Semgrep release takes both fixed packages.
    • Rejected: Pin Semgrep without checking its dependencies. It can keep or add advisories.
  • Does the change need a dependency on feat(research): find advisories for every pin #3898?: No. The check uses osv-scanner directly. feat(research): find advisories for every pin #3898 is the research path that found the advisories and remains a related item. (best practice) [sources: tests/research/test_advisories.py, tests/security/test_osv_scanner.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-09: in-use.
The item already names this tool.
Tool: google/osv-scanner (https://github.com/google/osv-scanner), Apache-2.0, last activity 2026-11-09, maintained.

Activity

  1. added
    source/agent
    type/bug
    scope/deps
    status/new
    value/medium
    effort/medium
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/deps. The (deps) scope of the title gives the scope.
    • Priority: P2-Medium. The advisories are real but the tools run in a no-network sandbox, so the risk is limited and not actively exploitable. The advisory GHSA-6q48-6c7w-9gw2 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 with the label priority/p0-critical.
    • Value: Medium. It prevents advisory regressions in tools lock files and closes a gap in the audit check, but the immediate user impact is low.
    • Effort: Medium. Requires integrating osv-scanner into the CI audit path, adding a test, and possibly updating pins in semgrep.txt and bandit.txt.
    • Related: feat(research): find advisories for every pin #3898, which asks for a different change. Both check for advisories in pinned packages, but #3898 delivers a research command and the candidate delivers a CI audit check that fails on tools lock requirement files.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 8, 2026
  5. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 1f03ee3 (see proposed design in issue body).

  6. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: The issue already names osv-scanner, and the project has an osv-scanner adapter. It is maintained (last push 2026-11-09, release v2.7.1) and reads hashed requirements files with --lockfile requirements.txt:<file>. It covers the advisory detection. It does not recompile the lock files or wire the check into devops ci audit, and the issue does not need it to. The web search returned nothing useful, so this rests on the repository facts and the issue text.

    The item already names this tool.

    Tool: google/osv-scanner (https://github.com/google/osv-scanner)

    • License: Apache-2.0
    • Last activity: 2026-11-09
    • Maintained: yes

    Covers:

    • Detects advisories in pinned requirements.txt files
    • Reports advisory ids per package
    • Maintained, Apache-2.0 licensed

    Lacks:

    • Does not regenerate semgrep.txt or bandit.txt from the pinned versions
    • Does not wire into devops ci audit or discover the tools_lock files
    • The project's own expiry-checking ignore policy is not part of the tool
    • Does not choose a Semgrep release that can take the fixed mcp and certifi

    Tools considered:

    Searches run:

    • osv-scanner scan requirements.txt lockfile advisories, results: 5

    Sources:

    Checked on 2026-11-09. A person decides what this means for the item. The check changes no label and closes no issue.

  7. dan-petty commented on Nov 16, 2026

    @dan-petty
    OwnerAuthor

    New evidence from #6032 (2026-11-16):

    • semgrep 1.185.0, the newest release, still requires mcp==1.29.0 and opentelemetry-api~=1.37.0 (PyPI metadata). So no release of semgrep holds the fixes yet.
    • uv 0.13.8 finds no solution for semgrep.in with --upgrade-package=mcp==1.30.0 or --upgrade-package=opentelemetry-api==1.45.2.
    • A second opentelemetry-api advisory exists: GHSA-mf5v-w3w3-f6cg, fixed in 1.45.2, published 2026-11-13.
    • certifi has a released fix, and Renovate opened fix(deps): update certifi to v2026.10.23 #6028 for it.

    PR #6040 holds the two fixes in .github/renovate.json while the semgrep lock is below the fix, and the Dependency Dashboard footer names this issue. The hold ends by itself when the lock takes the fix. Then test_renovate_holds_the_security_fixes_that_the_semgrep_pins_block fails, and the hold is deleted.

  8. dan-petty commented on Nov 16, 2026

    @dan-petty
    OwnerAuthor

    Owner, 2026-11-16: approved the two holds of this pull request (the mcp and opentelemetry-api security fixes in the semgrep tools lock only, while semgrep pins the vulnerable versions; #3988 owns the real fix). The holds end by themselves when the lock moves past the fix, and a test then asks for their removal.

  9. added
    owner/agent
    status/in-progress
    and removed
    status/ready
    on Nov 18, 2026
  10. added 2 commits that reference this issue on Nov 18, 2026
    4688bf7
    dbeb650
  11. removed
    status/in-progress
    owner/agent
    on Nov 18, 2026
  12. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-18 16:28 UTC

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

    effort/mediumpriority/p2-mediumscope/depssource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions