Skip to content

fix(design): audit the Style Dictionary lock in the gate #4777

Closed

Description

@dan-petty

Problem Description

Pull request of #4738 adds the Style Dictionary 5.7.1 lock in src/devops_cli/tools_lock/style-dictionary/ (106 packages, all with a permissive license). The lock is not an entry of tools.lock, so the audit row of devops ci does not audit it, and devops install-tools does not install it.

The reason: npm audit --package-lock-only of the lock names 6 findings, 2 low and 4 moderate, in the dependencies of Style Dictionary. The audit row fails on any finding, and the required check "Static Analysis" runs that row. No Style Dictionary release removes them (read on 2026-11-11):

  • deepmerge 4.3.1, GHSA-gcqx-w48m-w2h4 (low, published 2026-09-18): the advisory names no fixed version. 4.3.1 (2023-03-16) is the newest release. @bundled-es-modules/deepmerge 4.3.2 depends on it.
  • glob 13.0.6, GHSA-3g3m-2fjr-6pw4 (moderate, published 2026-10-30): fixed in 14.0.2. @bundled-es-modules/glob depends on glob 13.
  • minimatch 10.2.6, GHSA-g3hv-75wg-m249 (moderate, published 2026-10-30): fixed in 11.0.1.
  • Style Dictionary 5.8.0 (2026-11-03), the newest release, has the same dependencies as 5.7.1.

Style Dictionary reads only the committed token files and configs of design/. It runs in the CI job "Design Tokens" and in the devcontainer image, and the package and the Service image do not hold it.

Reproduction Steps

  1. Copy package.json and package-lock.json of src/devops_cli/tools_lock/style-dictionary/ to an empty directory.
  2. Run npm audit --package-lock-only --json there.
  3. Read metadata.vulnerabilities: {"low": 2, "moderate": 4, "total": 6}.

Expected vs Actual Behavior

Expected: Style Dictionary is a [npm.style-dictionary] entry of tools.lock, as OpenSpec is (ADR 0010), so the audit row audits its lock and devops install-tools --tool style-dictionary installs it. Actual: the lock is outside tools.lock, because the audit row would fail.

Steps:

  1. When a Style Dictionary release has dependencies with no finding (no minimum release age applies), update the lock (Renovate opens the pull request) and add the tools.lock entry, the NOT_IN_RUNNER reason in src/devops_cli/roadmap/runner_tools.py, and the devops install-tools path in docs/DESIGN.md.
  2. If the deepmerge advisory still has no fix after 14 days, the owner decides (SECURITY.md, "A Finding with No Fix"): npm audit has no ignore file, so the rule of time-limited ignore entries cannot apply to it.

Environment Diagnostics

npm 11.19.1, Node 24 (.node-version), lock resolved with npm install --package-lock-only --ignore-scripts --before=2026-10-28.

Logs, Traces, or Terminal Output

deepmerge  >=4.2.0  (low)  GHSA-gcqx-w48m-w2h4
glob  9.0.0 - 14.0.1  (moderate)  GHSA-3g3m-2fjr-6pw4
minimatch  7.0.0 - 11.0.0  (moderate)  GHSA-g3hv-75wg-m249
6 vulnerabilities (2 low, 4 moderate)

Source: #4738

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

Proposed design

Problem statement

The Style Dictionary lock is outside tools.lock. The audit row does not scan it, and devops install-tools does not install it. The audit row fails on six findings in its dependencies. The change adds the tools lock entry, installs the lock with devops install-tools, audits npm locks with osv-scanner, and records a time-limited ignore for deepmerge.

Acceptance criteria

Requirement: Tools lock entry

The tools lock MUST hold an npm.style-dictionary entry for the Style Dictionary lock at version 5.8.0.

Scenario: Read the tools lock

  • WHEN A test parses tools.lock.
  • THEN The parsed entry names version 5.8.0 and the lock directory src/devops_cli/tools_lock/style-dictionary/.

Requirement: Design spec states the install and audit paths

docs/DESIGN.md MUST name devops install-tools --tool style-dictionary as the install path and MUST state that the audit row audits the lock.

Scenario: Read the install section

  • WHEN A test reads the Install Style Dictionary section of docs/DESIGN.md.
  • THEN The section gives devops install-tools --tool style-dictionary and states the lock is in tools.lock and audited. It holds no manual npm ci step.

Requirement: Design Tokens job uses the tools lock

The Design Tokens job MUST install Style Dictionary with devops install-tools --tool style-dictionary and MUST NOT run the hand npm ci install.

Scenario: Read the Design Tokens job

  • WHEN A test reads the Design Tokens job in .github/workflows/ci.yml.
  • THEN The job holds devops install-tools --tool style-dictionary and no npm ci command for the lock.

Requirement: Audit row scans the npm locks

The audit row of devops ci MUST run the pinned osv-scanner on each npm lock under src/devops_cli/tools_lock/.

Scenario: Build the audit row command

  • WHEN A test builds the audit row command for the repository.
  • THEN The command names osv-scanner and the Style Dictionary package-lock.json.

Requirement: Time-limited ignore for deepmerge

The osv-scanner configuration MUST hold an IgnoredVulns entry for GHSA-gcqx-w48m-w2h4 with ignoreUntil 2026-11-25 and a reason.

Scenario: Read the scanner configuration

  • WHEN A test reads the osv-scanner configuration file that the audit row uses.
  • THEN The entry for GHSA-gcqx-w48m-w2h4 has ignoreUntil 2026-11-25 and a reason that names SECURITY.md.

Requirement: Fixed transitive versions

The Style Dictionary lock MUST override glob to 14.0.2 and minimatch to 11.0.1, and make design-tokens MUST pass.

Scenario: Build the design tokens

  • WHEN A test runs make design-tokens with the Style Dictionary lock.
  • THEN The lock resolves glob to 14.0.2 and minimatch to 11.0.1. The command exits 0 with unchanged outputs.

Requirement: Runner tool reasons

NOT_IN_RUNNER MUST name style-dictionary with its reason, MUST state that osv-scanner runs the audit row, and MUST NOT name npm audit.

Scenario: Read the runner tool table

  • WHEN A test imports NOT_IN_RUNNER from src/devops_cli/roadmap/runner_tools.py.
  • THEN The reasons for style-dictionary, osv-scanner and npm read as stated.

Requirement: Cluster doc states the audit tool

docs/CLUSTER.md MUST state that the audit row uses osv-scanner and MUST NOT state that npm is needed for the audit row.

Scenario: Read the cluster doc

  • WHEN A test reads the runner image section of docs/CLUSTER.md.
  • THEN The section names osv-scanner for the audit row and holds no text that says npm is needed for the audit row.

Requirement: ADR 0024 records the audit change

ADR 0024 MUST hold a Status History line that records the osv-scanner audit and the time-limited ignore rule.

Scenario: Read the ADR

  • WHEN A test reads docs/adr/0024-the-project-owns-its-design-tokens-in-the-dtcg-format-and-style-dictionary-builds-them.md.
  • THEN The Status History holds a dated line that names osv-scanner and SECURITY.md.

Existing Tool Considered

google/osv-scanner (Apache-2.0, maintained) already scans npm package-lock.json files. It supports IgnoredVulns entries with ignoreUntil and a reason. It lacks only the project's tools.lock entry and devops install-tools path.

Key questions

  • What release age applies to the Style Dictionary lock?: No minimum release age applies. Pin Style Dictionary 5.8.0, the newest release, when the tests pass. (best practice) [sources: CONTRIBUTING.md, src/devops_cli/tools_lock/style-dictionary/package-lock.json]
    • Chosen: No minimum release age. The owner direction of 2026-11-11 removes the 14-day rule for dependencies and tools.
    • Rejected: 14-day minimum release age. The owner direction rejects it because security fixes can need an immediate update.
  • Which tool audits the npm locks and records a time-limited ignore?: Use google/osv-scanner. The repository already uses it. It scans package-lock.json and supports IgnoredVulns with ignoreUntil and a reason. npm audit has no ignore file. (best practice) [sources: src/devops_cli/commands/ci.py:2356, src/devops_cli/tools_lock/style-dictionary/package-lock.json]
    • Chosen: google/osv-scanner. It is in use, maintained, and covers npm locks with time-limited ignores.
    • Rejected: npm audit. It has no ignore file for a finding with no fix.
    • Rejected: jeemok/better-npm-audit. It adds a second audit tool, and osv-scanner already covers the need.
  • How should the lock remove the glob and minimatch findings?: Use npm overrides to resolve glob 14.0.2 and minimatch 11.0.1. Run make design-tokens to prove the build. (best practice) [sources: src/devops_cli/tools_lock/style-dictionary/package.json, src/devops_cli/tools_lock/style-dictionary/package-lock.json]
    • Chosen: npm overrides to the fixed versions. Fixed releases exist, so SECURITY.md prefers a fix over an ignore.
    • Rejected: Time-limited ignores for both. An ignore is for a finding with no released fix.
    • Rejected: Leave the findings. The audit row would fail.
  • How should the lock handle the deepmerge finding with no fix?: Add an osv-scanner IgnoredVulns entry for GHSA-gcqx-w48m-w2h4 with ignoreUntil 2026-11-25 and a reason. (best practice) [sources: SECURITY.md, src/devops_cli/tools_lock/style-dictionary/package-lock.json]
    • Chosen: Time-limited ignore with an expiry. SECURITY.md permits a time-limited ignore for a finding with no fix.
    • Rejected: Remove Style Dictionary from the tools lock. The design token pipeline needs the tool.
    • Rejected: Keep the lock outside tools.lock. That leaves the lock unaudited and uninstalled by install-tools.
  • Where does Style Dictionary install from?: Use devops install-tools --tool style-dictionary. Delete the hand npm ci install at .github/workflows/ci.yml:832-841. (best practice) [sources: docs/DESIGN.md, src/devops_cli/roadmap/runner_tools.py, .github/workflows/ci.yml:832-841]
    • Chosen: devops install-tools --tool style-dictionary. It uses the tools lock and the same path as OpenSpec.
    • Rejected: Hand npm ci in the CI job. It bypasses the tools lock and the install-tools path.
  • Does the runner image need Style Dictionary or osv-scanner?: No. Add style-dictionary to NOT_IN_RUNNER with the Design Tokens reason. State that the audit row runs osv-scanner in Static Analysis. (best practice) [sources: src/devops_cli/roadmap/runner_tools.py, docs/DESIGN.md, .github/workflows/ci.yml]
    • Chosen: Leave both out of the runner image. Only the Design Tokens job and the Static Analysis audit row run them.
    • Rejected: Add both to RUNNER_TOOLS. The runner image does not run the Design Tokens job or the audit row.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5225

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/bug
    status/new
    value/medium
    effort/low
    on Nov 11, 2026
  3. dan-petty commented on Nov 11, 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: none. The title has the scope design, and .github/labels.yml declares no scope/design label. Add the label to the file to give the scope to this item.
    • Priority: P2-Medium. The tool runs in CI and devcontainer but not in the Service image, and the findings are low and moderate severity. The advisory GHSA-gcqx-w48m-w2h4 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 closes an audit gap for a tool used in CI and devcontainer, but the tool is not in the production Service image.
    • Effort: Low. The change is adding a lock entry to tools.lock, a NOT_IN_RUNNER reason, and a docs update; the blocking factor is upstream dependency fixes.
    • Related: fix(deps): check the tools lock requirement files for advisories #3988, which asks for a different change. Both extend audit coverage to files in tools_lock, but #3988 targets hashed requirement files (txt) while the candidate targets an npm package-lock.json.
  4. added
    priority/p2-medium
    on Nov 11, 2026
  5. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Owner direction of 2026-11-11:

    not sure about the "at least two weeks old" rule, sometimes security updates and bugfixes need to be used within minues of their release, as long as the tooling supports that version, it is fine to update

    New rule: no minimum release age for dependencies, images, charts or tools. Pin the newest release that fixes the known security and bug issues and that the surrounding tools support (the tests pass).

    Body changes: the 14-day conditions on the Style Dictionary release are removed. The findings stay: 5.8.0, the newest release, has the same dependencies as 5.7.1. Step 2 (the owner decides when the deepmerge advisory has no fix) did not change, because SECURITY.md sets that rule, not the release age.

  6. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Update from pull request #4811 (2026-11-11):

    • CONTRIBUTING.md, "Dependency Versions" (owner, 2026-11-11), now sets no minimum release age. So the lock pins Style Dictionary 5.8.0, the newest release, and the Renovate rule of the lock has no minimumReleaseAge.
    • npm audit --package-lock-only of the 5.8.0 lock names the same 6 findings (2 low, 4 moderate). The ranges of Style Dictionary 5.8.0 (@bundled-es-modules/glob ^13.0.6-hotfix.0, @bundled-es-modules/deepmerge ^4.3.2) do not permit the fixed glob 14.0.2 and minimatch 11.0.1, and deepmerge has no fixed release.
    • So the condition of step 1 is now: a Style Dictionary release whose dependencies have no finding, with no age limit.
  7. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    The ADR modernization (tracker ) folds its child 20 into this item, so this item gets a wider scope (ADR 0024 decision 5 reverses under the SECURITY.md finding rule):

    • Add [npm.style-dictionary] to tools.lock, and delete the hand install at ci.yml:832-841.
    • Audit the npm locks with the pinned osv-scanner. Each finding with no released fix gets an IgnoredVulns entry with ignoreUntil and a reason, under the SECURITY.md finding rule. deepmerge has no fix, so it goes to the owner at the 14-day cap.
    • Try npm overrides for glob and minimatch.
    • Add a Status History line to ADR 0024.

    Dependencies: #5225 (the ADR front matter) and the CI duration alarm item of the tracker, because both change ci.yml.

  8. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: The searches found that osv-scanner reads npm package-lock.json files and supports IgnoredVulns entries that carry an expiry date and a reason, which is exactly the audit capability this issue lacks from npm audit (no ignore file, so a no-fix finding such as the deepmerge advisory blocks the audit row). The reply's plan itself names the pinned osv-scanner for auditing the npm locks, so it covers the need of auditing the Style Dictionary lock in the gate with time-limited ignores; only the project's own plumbing (tools.lock entry, install-tools path) stays outside any tool.

    The repository already uses this tool.

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

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

    Covers:

    • Scans npm package-lock.json lockfiles (and other ecosystems' locks) for known vulnerabilities
    • Supports IgnoredVulns entries with an expiry date and a reason, so a finding with no released fix can be ignored for a limited time, per the SECURITY.md finding rule
    • PackageOverrides can ignore a package's vulnerabilities or licenses, also with an optional expiry date and reason
    • Runs in CI with a configurable failure exit code, so it can back the gate's audit row

    Lacks:

    • Does not add the [npm.style-dictionary] entry to tools.lock or the devops install-tools path; that is the project's own integration work, not a tool capability

    Tools considered:

    Searches run:

    • osv-scanner ignore vulnerabilities ignoreUntil npm package-lock.json, results: 5
    • npm audit ignore file allowlist advisories with no fix alternative tool, results: 5

    Sources:

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

  9. added
    status/ready
    and removed
    status/new
    on Nov 15, 2026
  10. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

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

    Moved to new items: #5812.

  11. added a commit that references this issue on Nov 18, 2026
  12. added
    status/in-progress
    and removed
    status/ready
    on Nov 18, 2026
  13. added 2 commits that reference this issue on Nov 18, 2026
  14. added
    status/in-review
    and removed
    status/in-progress
    on Nov 18, 2026
  15. removed
    status/in-review
    on Nov 18, 2026
  16. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor
  17. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-18 13:25 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/lowpriority/p2-mediumsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions