eslint-plugin-traceability 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/CHANGELOG.md +5 -5
  2. package/README.md +28 -29
  3. package/SECURITY.md +135 -0
  4. package/lib/src/index.d.ts +6 -35
  5. package/lib/src/index.js +8 -5
  6. package/lib/src/maintenance/cli.js +12 -16
  7. package/lib/src/maintenance/detect.js +28 -1
  8. package/lib/src/rules/helpers/require-story-io.d.ts +2 -2
  9. package/lib/src/rules/helpers/require-story-io.js +13 -13
  10. package/lib/src/rules/helpers/valid-annotation-format-internal.d.ts +2 -2
  11. package/lib/src/rules/helpers/valid-annotation-format-internal.js +3 -3
  12. package/lib/src/rules/helpers/valid-annotation-utils.d.ts +5 -0
  13. package/lib/src/rules/helpers/valid-annotation-utils.js +43 -5
  14. package/lib/src/rules/helpers/valid-implements-utils.d.ts +11 -11
  15. package/lib/src/rules/helpers/valid-implements-utils.js +11 -11
  16. package/lib/src/rules/helpers/valid-story-reference-helpers.js +19 -0
  17. package/lib/src/rules/prefer-implements-annotation.d.ts +7 -7
  18. package/lib/src/rules/prefer-implements-annotation.js +21 -21
  19. package/lib/src/rules/valid-annotation-format.js +50 -24
  20. package/lib/src/rules/valid-req-reference.js +9 -9
  21. package/lib/src/utils/annotation-checker.js +3 -1
  22. package/lib/src/utils/reqAnnotationDetection.d.ts +2 -2
  23. package/lib/src/utils/reqAnnotationDetection.js +28 -28
  24. package/lib/tests/config/flat-config-presets-integration.test.d.ts +1 -0
  25. package/lib/tests/config/flat-config-presets-integration.test.js +75 -0
  26. package/lib/tests/maintenance/batch.test.js +11 -11
  27. package/lib/tests/maintenance/cli.test.js +34 -27
  28. package/lib/tests/maintenance/report.test.js +7 -7
  29. package/lib/tests/plugin-default-export-and-configs.test.js +0 -2
  30. package/lib/tests/rules/prefer-implements-annotation.test.js +48 -15
  31. package/lib/tests/rules/require-branch-annotation.test.js +15 -36
  32. package/lib/tests/rules/require-req-annotation.test.js +31 -104
  33. package/lib/tests/rules/require-story-annotation.test.js +3 -3
  34. package/lib/tests/rules/require-story-io-behavior.test.js +2 -7
  35. package/lib/tests/rules/require-story-io.edgecases.test.js +2 -7
  36. package/lib/tests/rules/require-story-visitors-edgecases.test.js +8 -8
  37. package/lib/tests/rules/valid-annotation-format.test.js +23 -23
  38. package/lib/tests/rules/valid-req-reference.test.js +9 -9
  39. package/lib/tests/rules/valid-story-reference.test.js +4 -43
  40. package/lib/tests/utils/annotation-checker.test.js +2 -6
  41. package/lib/tests/utils/fsTestHelpers.d.ts +7 -0
  42. package/lib/tests/utils/fsTestHelpers.js +26 -0
  43. package/lib/tests/utils/ioTestHelpers.d.ts +7 -0
  44. package/lib/tests/utils/ioTestHelpers.js +24 -0
  45. package/lib/tests/utils/temp-dir-helpers.d.ts +14 -0
  46. package/lib/tests/utils/temp-dir-helpers.js +61 -0
  47. package/package.json +8 -7
  48. package/user-docs/api-reference.md +37 -20
  49. package/user-docs/eslint-9-setup-guide.md +89 -6
  50. package/user-docs/migration-guide.md +37 -21
  51. package/docs/ci-cd-pipeline.md +0 -224
  52. package/docs/cli-integration.md +0 -22
  53. package/docs/code-quality-refactor-opportunities-2025-12-03.md +0 -78
  54. package/docs/config-presets.md +0 -38
  55. package/docs/conventional-commits-guide.md +0 -185
  56. package/docs/custom-rules-development-guide.md +0 -659
  57. package/docs/decisions/0001-allow-dynamic-require-for-built-plugins.md +0 -26
  58. package/docs/decisions/001-typescript-for-eslint-plugin.accepted.md +0 -111
  59. package/docs/decisions/002-jest-for-eslint-testing.accepted.md +0 -137
  60. package/docs/decisions/003-code-quality-ratcheting-plan.md +0 -48
  61. package/docs/decisions/004-automated-version-bumping-for-ci-cd.md +0 -196
  62. package/docs/decisions/005-github-actions-validation-tooling.accepted.md +0 -144
  63. package/docs/decisions/006-semantic-release-for-automated-publishing.accepted.md +0 -227
  64. package/docs/decisions/007-github-releases-over-changelog.accepted.md +0 -216
  65. package/docs/decisions/008-ci-audit-flags.accepted.md +0 -60
  66. package/docs/decisions/009-security-focused-lint-rules.accepted.md +0 -64
  67. package/docs/decisions/010-implements-annotation-for-multi-story-requirements.proposed.md +0 -184
  68. package/docs/decisions/adr-0001-console-usage-for-cli-guards.md +0 -190
  69. package/docs/decisions/adr-accept-dev-dep-risk-glob.md +0 -40
  70. package/docs/decisions/adr-commit-branch-tests.md +0 -54
  71. package/docs/decisions/adr-maintenance-cli-interface.md +0 -140
  72. package/docs/decisions/adr-pre-push-parity.md +0 -112
  73. package/docs/decisions/code-quality-ratcheting-plan.md +0 -53
  74. package/docs/dependency-health.md +0 -238
  75. package/docs/eslint-9-setup-guide.md +0 -517
  76. package/docs/eslint-plugin-development-guide.md +0 -487
  77. package/docs/functionality-coverage-2025-12-03.md +0 -250
  78. package/docs/jest-testing-guide.md +0 -100
  79. package/docs/rules/prefer-implements-annotation.md +0 -219
  80. package/docs/rules/require-branch-annotation.md +0 -71
  81. package/docs/rules/require-req-annotation.md +0 -203
  82. package/docs/rules/require-story-annotation.md +0 -159
  83. package/docs/rules/valid-annotation-format.md +0 -418
  84. package/docs/rules/valid-req-reference.md +0 -153
  85. package/docs/rules/valid-story-reference.md +0 -120
  86. package/docs/security-incidents/2025-11-17-glob-cli-incident.md +0 -45
  87. package/docs/security-incidents/2025-11-18-brace-expansion-redos.md +0 -45
  88. package/docs/security-incidents/2025-11-18-bundled-dev-deps-accepted-risk.md +0 -93
  89. package/docs/security-incidents/2025-11-18-tar-race-condition.md +0 -43
  90. package/docs/security-incidents/2025-12-03-dependency-health-review.md +0 -58
  91. package/docs/security-incidents/SECURITY-INCIDENT-2025-11-18-semantic-release-bundled-npm.known-error.md +0 -104
  92. package/docs/security-incidents/SECURITY-INCIDENT-TEMPLATE.md +0 -37
  93. package/docs/security-incidents/dependency-override-rationale.md +0 -57
  94. package/docs/security-incidents/dev-deps-high.json +0 -116
  95. package/docs/security-incidents/handling-procedure.md +0 -54
  96. package/docs/stories/001.0-DEV-PLUGIN-SETUP.story.md +0 -92
  97. package/docs/stories/002.0-DEV-ESLINT-CONFIG.story.md +0 -82
  98. package/docs/stories/003.0-DEV-FUNCTION-ANNOTATIONS.story.md +0 -112
  99. package/docs/stories/004.0-DEV-BRANCH-ANNOTATIONS.story.md +0 -153
  100. package/docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story.md +0 -138
  101. package/docs/stories/006.0-DEV-FILE-VALIDATION.story.md +0 -144
  102. package/docs/stories/007.0-DEV-ERROR-REPORTING.story.md +0 -163
  103. package/docs/stories/008.0-DEV-AUTO-FIX.story.md +0 -150
  104. package/docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md +0 -117
  105. package/docs/stories/010.0-DEV-DEEP-VALIDATION.story.md +0 -124
  106. package/docs/stories/010.1-DEV-CONFIGURABLE-PATTERNS.story.md +0 -149
  107. package/docs/stories/010.2-DEV-MULTI-STORY-SUPPORT.story.md +0 -216
  108. package/docs/stories/010.3-DEV-MIGRATE-TO-IMPLEMENTS.story.md +0 -236
  109. package/docs/stories/developer-story.map.md +0 -120
  110. package/docs/ts-jest-presets-guide.md +0 -548
@@ -1,45 +0,0 @@
1
- # Security Incident Report: glob CLI Vulnerability
2
-
3
- **Date:** 2025-11-18 (Updated)
4
-
5
- **Dependency:** glob (versions 10.3.7 – 11.0.3) bundled in npm@11.6.2 within @semantic-release/npm@10.0.6
6
-
7
- **Vulnerability ID:** GHSA-5j98-mcp5-4vw2
8
-
9
- **Severity:** high
10
-
11
- **Description:**
12
- A command injection vulnerability in the glob CLI when using the `-c/--cmd` option, which executes matches with `shell:true`. An attacker able to control glob patterns could execute arbitrary shell commands.
13
-
14
- **Remediation:**
15
-
16
- - **Status:** Accepted as residual risk (bundled dependency - cannot be overridden)
17
- - **Fixed Version:** Awaiting upstream patch in npm package bundled within @semantic-release/npm
18
-
19
- **References:**
20
-
21
- - https://github.com/advisories/GHSA-5j98-mcp5-4vw2
22
-
23
- **Timeline:**
24
-
25
- - **2025-11-17:** Identified vulnerability in dev dependencies via npm audit
26
- - **2025-11-17:** Initial decision to monitor and await upstream patch
27
- - **2025-11-18:** Identified as bundled dependency in @semantic-release/npm that cannot be overridden
28
- - **2025-11-18:** Accepted as residual risk with documented mitigation
29
-
30
- **Impact Analysis:**
31
- This vulnerability affects development-time CLI tools bundled within the npm package used by semantic-release for automated publishing. The vulnerability requires specific CLI usage patterns (`-c/--cmd` flag) that are not used in our CI/CD workflow. The plugin itself does not pass untrusted patterns to glob. Risk to the project and downstream users is minimal as:
32
- - Dev dependency only (not in production)
33
- - Requires specific CLI flags not used in our workflow
34
- - Isolated to CI/CD publishing process
35
- - No end-user exposure
36
-
37
- **Testing:**
38
- Continuous `npm audit` checks in CI and pre-push hooks will detect if this vulnerability is resolved or if new vulnerabilities are introduced.
39
-
40
- **Status (2025-11-23):**
41
- As of 2025-11-23, dry-aged-deps reports no mature, dry-aged safe upgrade path for the affected glob dependency bundled via @semantic-release/npm. The risk remains accepted for dev-only tooling, with continued monitoring for an upstream fix.
42
-
43
- ## Status Update
44
-
45
- This incident is now covered by `SECURITY-INCIDENT-2025-11-18-semantic-release-bundled-npm.known-error.md`. Refer to that document for the current status, compensating controls, and ongoing mitigation tracking.
@@ -1,45 +0,0 @@
1
- # Security Incident Report: brace-expansion ReDoS
2
-
3
- **Date:** 2025-11-18
4
-
5
- **Dependency:** brace-expansion (1.0.0 - 1.1.11 and 2.0.0 - 2.0.1) bundled in npm within @semantic-release/npm@10.0.6
6
-
7
- **Vulnerability ID:** GHSA-v6h2-p8h4-qcjw
8
-
9
- **Severity:** low
10
-
11
- **Description:**
12
- A Regular Expression Denial of Service (ReDoS) vulnerability in brace-expansion affecting versions 1.0.0-1.1.11 and 2.0.0-2.0.1. An attacker who can control the input to brace-expansion could cause high CPU usage through crafted regex patterns.
13
-
14
- **Remediation:**
15
-
16
- - **Status:** Accepted as residual risk (bundled dependency - cannot be overridden)
17
- - **Fixed Version:** Awaiting upstream patch in npm package bundled within @semantic-release/npm
18
-
19
- **References:**
20
-
21
- - https://github.com/advisories/GHSA-v6h2-p8h4-qcjw
22
-
23
- **Timeline:**
24
-
25
- - **2025-11-18:** Identified vulnerability in dev dependencies via npm audit
26
- - **2025-11-18:** Identified as bundled dependency in @semantic-release/npm that cannot be overridden
27
- - **2025-11-18:** Accepted as residual risk with documented mitigation
28
-
29
- **Impact Analysis:**
30
- This vulnerability affects development-time dependencies bundled within the npm package used by semantic-release for automated publishing. The ReDoS vulnerability requires control over input patterns to brace-expansion, which is not exposed in our CI/CD workflow. Risk to the project and downstream users is minimal as:
31
- - Dev dependency only (not in production)
32
- - Low severity (DoS only, no data exposure)
33
- - Requires attacker-controlled input patterns
34
- - Isolated to CI/CD publishing process
35
- - No end-user exposure
36
- - No production code impact
37
-
38
- **Testing:**
39
- Continuous `npm audit` checks in CI and pre-push hooks will detect if this vulnerability is resolved or if new vulnerabilities are introduced.
40
-
41
- **Status Update (2025-11-23):**
42
- As of 2025-11-23, there is still no mature, dry-aged safe upgrade path available according to dry-aged-deps for the bundled npm dependency chain containing brace-expansion. The vulnerability continues to be tracked, and the risk remains accepted as a dev-only residual risk with no production impact.
43
-
44
- **Status Update (2025-12-03):**
45
- This incident is now covered by `SECURITY-INCIDENT-2025-11-18-semantic-release-bundled-npm.known-error.md`. Please refer to that document for the current status, mitigation details, and compensating controls.
@@ -1,93 +0,0 @@
1
- # Security Incident (Historical): Bundled Dev Dependencies Accepted as Residual Risk
2
-
3
- **Date**: 2025-11-18
4
- **Severity**: High (glob), Low (brace-expansion)
5
- **Status**: Superseded by known error record (historical context only)
6
- **Affected Package**: @semantic-release/npm@10.0.6 (bundled dependencies)
7
-
8
- ## Superseded Notice
9
-
10
- This incident document has been superseded by the known error record:
11
- **[SECURITY-INCIDENT-2025-11-18-semantic-release-bundled-npm.known-error.md](SECURITY-INCIDENT-2025-11-18-semantic-release-bundled-npm.known-error.md)**
12
-
13
- It is retained only for historical background and should not be used as the current source of truth for status or mitigation details.
14
-
15
- ## Summary
16
-
17
- The @semantic-release/npm package (v10.0.6) includes the npm package which bundles vulnerable versions of glob and brace-expansion that cannot be automatically fixed or overridden.
18
-
19
- Where possible, we now mitigate related transitive risks via explicit `package.json` overrides (e.g., glob, tar, http-cache-semantics, ip, semver, socks). However, the specific npm instance bundled inside @semantic-release/npm remains partially outside our direct control. The accepted residual risk described in this document applies only to those un-overridable, bundled instances.
20
-
21
- ## Vulnerabilities
22
-
23
- ### 1. glob CLI Vulnerability (GHSA-5j98-mcp5-4vw2)
24
- - **Severity**: High
25
- - **Affected versions**: glob 10.3.7 - 11.0.3
26
- - **Status**: Accepted as residual risk
27
- - **Rationale**:
28
- - Dev-dependency only (used by semantic-release for publishing)
29
- - Vulnerability requires specific CLI usage (`-c/--cmd` flag) not used in our workflow
30
- - Bundled dependency cannot be overridden within the npm copy embedded in @semantic-release/npm
31
- - Transitive glob risks in the wider dependency graph are additionally mitigated via explicit `package.json` overrides
32
- - No production impact
33
- - Awaiting upstream patch in npm package
34
-
35
- ### 2. brace-expansion ReDoS (GHSA-v6h2-p8h4-qcjw)
36
- - **Severity**: Low
37
- - **Affected versions**: 1.0.0 - 1.1.11 and 2.0.0 - 2.0.1
38
- - **Status**: Accepted as residual risk
39
- - **Rationale**:
40
- - Dev-dependency only (bundled in npm package within @semantic-release/npm)
41
- - Low severity ReDoS requires attacker-controlled input patterns
42
- - No production impact
43
- - Bundled dependency within the embedded npm cannot be overridden
44
- - Related transitive ReDoS surface is further constrained via dependency overrides where technically feasible
45
- - Awaiting upstream patch in npm package
46
-
47
- ## Risk Acceptance Decision
48
-
49
- **Decision**: Accept these vulnerabilities as residual risk
50
- **Decision Date**: 2025-11-18
51
- **Reviewed By**: Automated security assessment
52
-
53
- **Justification**:
54
- 1. **Scope Limitation**: Dev-dependency only (used by semantic-release for publishing in CI/CD)
55
- 2. **No Production Impact**: Vulnerabilities isolated to development/publishing process, no end-user or production code exposure
56
- 3. **Usage Pattern**: The glob CLI vulnerability requires specific `-c/--cmd` flag usage not present in our workflow
57
- 4. **Technical Constraint**: Bundled dependencies within the npm package embedded in @semantic-release/npm cannot be overridden via package.json
58
- 5. **Risk Narrowing via Overrides**: For non-bundled, transitive dependencies we enforce safer versions via explicit `package.json` overrides (glob, tar, http-cache-semantics, ip, semver, socks), so the accepted residual risk applies only to the remaining un-overridable, bundled instances
59
- 6. **Severity vs Impact**: Low/High severity ratings don't reflect actual risk given our limited usage context and CI/CD isolation
60
- 7. **Monitoring & Controls**: Continuing to monitor for upstream patches in npm and semantic-release packages, and relying on additional CI safety checks (e.g., `ci-safety-deps`, `dry-aged-deps`) to catch regressions or newly introduced risky versions
61
-
62
- ## Mitigation Measures
63
-
64
- - Continue monitoring npm audit reports for upstream fixes
65
- - Review and upgrade semantic-release packages when new versions are released
66
- - Enforce explicit `package.json` overrides for vulnerable or risky transitive dependencies where technically possible (e.g., glob, tar, http-cache-semantics, ip, semver, socks)
67
- - Use CI dependency safety tooling (`ci-safety-deps`, `dry-aged-deps`) to:
68
- - Detect newly introduced vulnerable versions
69
- - Ensure overrides remain effective across dependency updates
70
- - Isolate CI/CD publishing process from untrusted input
71
- - Regular (weekly) review of dev-dependency audit status
72
-
73
- ## Review Schedule
74
-
75
- - **Next Review**: 2025-11-25 (7 days)
76
- - **Escalation Trigger**: New vulnerability in bundled dependencies OR upstream patch available
77
-
78
- ## Related Incidents
79
-
80
- - [2025-11-17 glob CLI incident](2025-11-17-glob-cli-incident.md) - Original glob vulnerability documentation
81
-
82
- ## Previously Resolved
83
-
84
- - **js-yaml (GHSA-mh29-5h37-fv8m)**: Prototype pollution vulnerability resolved by upgrading to `js-yaml` >= 4.1.1 via `npm audit fix` and package.json override.
85
- - **tar (node-tar) (CVE-2023-47146)**: Arbitrary file write via directory traversal vulnerability resolved by enforcing `tar` >= 6.1.11 via package.json override.
86
- - **tar race condition (GHSA-29xp-372q-xqph)**: Resolved by downgrading semantic-release packages to v10.x/v21.x which don't bundle vulnerable npm versions.
87
-
88
- ## Status Update (2025-11-23)
89
-
90
- As of 2025-11-23:
91
- - The previously documented glob/npm/brace-expansion vulnerabilities remain present only within dev tooling (semantic-release/@semantic-release/npm bundled npm).
92
- - `dry-aged-deps` has not yet surfaced a mature, vulnerability-free upgrade path for the affected semantic-release/npm combination.
93
- - The existing risk acceptance decision is unchanged and remains in force, and will be revisited once a stable, vulnerability-free upgrade is available and validated by our dependency safety tooling.
@@ -1,43 +0,0 @@
1
- # Security Incident Report: tar Race Condition
2
-
3
- **Date:** 2025-11-18
4
-
5
- **Dependency:** tar@7.5.1 bundled in npm@11.6.2 within @semantic-release/npm@10.0.6
6
-
7
- **Vulnerability ID:** GHSA-29xp-372q-xqph
8
-
9
- **Severity:** moderate
10
-
11
- **Description:**
12
- A race condition vulnerability in node-tar that can lead to uninitialized memory exposure. This vulnerability affects tar version 7.5.1 specifically.
13
-
14
- **Remediation:**
15
-
16
- - **Status:** Mitigated / resolved via dependency overrides and upstream updates
17
- - **Fixed Version:** tar >=6.1.12 enforced via overrides; current npm audit reports no active tar-related vulnerabilities in the dependency tree.
18
-
19
- **References:**
20
-
21
- - https://github.com/advisories/GHSA-29xp-372q-xqph
22
-
23
- **Timeline:**
24
-
25
- - **2025-11-18:** Identified vulnerability in dev dependencies via npm audit
26
- - **2025-11-18:** Identified as bundled dependency in @semantic-release/npm that cannot be overridden
27
- - **2025-11-18:** Accepted as residual risk with documented mitigation
28
- - **2025-11-21:** Confirmed mitigated: overrides in package.json and upstream updates mean npm audit no longer reports GHSA-29xp-372q-xqph for this project. Incident reclassified from residual risk to resolved.
29
-
30
- **Impact Analysis:**
31
- This vulnerability affects development-time dependencies bundled within the npm package used by semantic-release for automated publishing. The race condition requires specific timing conditions and is isolated to the CI/CD publishing process. Risk to the project and downstream users is minimal as:
32
- - Dev dependency only (not in production)
33
- - Race condition requires specific timing scenarios
34
- - Isolated to CI/CD publishing process
35
- - No end-user exposure
36
- - No production code impact
37
-
38
- **Current Status (as of 2025-11-21):**
39
-
40
- Subsequent dependency updates and the `tar` override (`tar >=6.1.12`) have removed the vulnerable version from the active dependency graph. Automated `npm audit --omit=dev --audit-level=high` checks report no tar-related vulnerabilities. This incident remains documented for historical purposes but does not represent an ongoing risk.
41
-
42
- **Testing:**
43
- Continuous `npm audit` checks in CI and pre-push hooks will detect if this vulnerability is resolved or if new vulnerabilities are introduced.
@@ -1,58 +0,0 @@
1
- # Dependency Health Review - 2025-12-03
2
-
3
- **Date:** 2025-12-03
4
-
5
- This document records the dependency health status of the project as of 2025-12-03, based on `dry-aged-deps` and existing security incident records.
6
-
7
- ## Tools and Inputs
8
-
9
- - `npm run deps:maturity -- --format=json --check`
10
- - `npm audit --omit=dev --audit-level=high` (via `ci-verify:full`)
11
- - Dev-dependency audit snapshot: `docs/security-incidents/dev-deps-high.json`
12
- - Known error record: `docs/security-incidents/SECURITY-INCIDENT-2025-11-18-semantic-release-bundled-npm.known-error.md`
13
-
14
- ## dry-aged-deps Summary
15
-
16
- Running `npm run deps:maturity -- --format=json --check` produced the following high-level summary:
17
-
18
- ```json
19
- {
20
- "packages": [],
21
- "summary": {
22
- "totalOutdated": 0,
23
- "safeUpdates": 0,
24
- "filteredByAge": 0,
25
- "filteredBySecurity": 0,
26
- "thresholds": {
27
- "prod": { "minAge": 7, "minSeverity": "none" },
28
- "dev": { "minAge": 7, "minSeverity": "none" }
29
- }
30
- }
31
- }
32
- ```
33
-
34
- Interpretation:
35
-
36
- - `packages: []` indicates that `dry-aged-deps` did not identify any direct or transitive dependencies with dry-aged-safe upgrade candidates under the current thresholds.
37
- - `totalOutdated: 0` and `safeUpdates: 0` confirm that, as of this run, there are no library updates that meet the project’s maturity and security criteria.
38
-
39
- ## Production Dependency Health
40
-
41
- - `npm audit --omit=dev --audit-level=high` currently reports **0 high-severity (or higher) vulnerabilities** for production dependencies.
42
- - This check is enforced as part of `npm run ci-verify:full` and runs on every push to `main` in the CI/CD pipeline.
43
-
44
- ## Development Dependency Health
45
-
46
- - High-severity dev-only vulnerabilities are tracked in `docs/security-incidents/dev-deps-high.json` and surfaced via `npm run audit:dev-high` and `npm run safety:deps`.
47
- - The remaining known high-severity items are limited to the bundled `npm` and its transitive `glob`/`brace-expansion` dependencies inside `@semantic-release/npm`, as documented in `SECURITY-INCIDENT-2025-11-18-semantic-release-bundled-npm.known-error.md` and the ADR `adr-accept-dev-dep-risk-glob.md`.
48
- - `dry-aged-deps` currently reports no safe, policy-compliant upgrade path for this toolchain; specifically, there are no candidates that both:
49
- - Satisfy the configured minimum age thresholds for prod and dev dependencies, and
50
- - Resolve the bundled `glob`/`brace-expansion` advisories without introducing new issues.
51
-
52
- ## Conclusion
53
-
54
- - **No dependency updates were applied** as a result of this review, because `dry-aged-deps` reported `totalOutdated: 0` and `safeUpdates: 0`.
55
- - Production dependencies remain free of high-severity vulnerabilities according to `npm audit --omit=dev --audit-level=high`.
56
- - The previously documented dev-only vulnerability in the semantic-release/npm toolchain remains a **known error** with compensating controls and is still considered an accepted residual risk.
57
-
58
- This document should be updated or superseded on subsequent dependency health reviews when `dry-aged-deps` identifies new safe upgrade candidates or when the known error for the semantic-release/npm toolchain is resolved.
@@ -1,104 +0,0 @@
1
- # Security Incident Report: semantic-release bundled npm/glob/brace-expansion
2
-
3
- **Date:** 2025-11-18
4
-
5
- **Dependency:** @semantic-release/npm@10.0.6 (bundled npm@9.5.0 with glob and brace-expansion)
6
-
7
- **Vulnerability ID:** GHSA-5j98-mcp5-4vw2 (glob CLI), GHSA-v6h2-p8h4-qcjw (brace-expansion ReDoS)
8
-
9
- **Severity:** High (glob via npm), Low (brace-expansion)
10
-
11
- **Description:**
12
-
13
- The `@semantic-release/npm@10.0.6` dev dependency bundles `npm@9.5.0`, which in turn includes vulnerable versions of `glob` and `brace-expansion`:
14
-
15
- - `glob` (10.2.010.4.5) is affected by command injection when the glob CLI is invoked with the `-c/--cmd` flag (`GHSA-5j98-mcp5-4vw2`).
16
- - `brace-expansion` (1.0.01.1.11 and 2.0.02.0.1) is affected by a Regular Expression Denial of Service (ReDoS) issue (`GHSA-v6h2-p8h4-qcjw`).
17
-
18
- These vulnerable packages are *only* present inside the npm binary bundled within `@semantic-release/npm`. They are **not** part of the production dependency tree used by the published `eslint-plugin-traceability` package.
19
-
20
- **Remediation:**
21
-
22
- - **Status:** Known error with compensating controls (dev-only tooling)
23
- - **Fixed Version:** Pending
24
-
25
- As of 2025-12-03:
26
-
27
- - `npm run deps:maturity -- --format=json` reports no safe, dry-aged upgrade candidates for `@semantic-release/npm` within the current semantic-release v21.x toolchain used by this project.
28
- - Upgrading to the latest `semantic-release@25.x` and `@semantic-release/npm@13.1.2` would require a coordinated major toolchain migration and may still embed a bundled `npm` implementation; the security characteristics of that new bundle have not yet been fully evaluated.
29
-
30
- Given these constraints, the project treats this as a **known error** in dev-only tooling and applies compensating controls instead of attempting a premature upgrade.
31
-
32
- **References:**
33
-
34
- - GitHub Security Advisory (glob CLI): https://github.com/advisories/GHSA-5j98-mcp5-4vw2
35
- - GitHub Security Advisory (brace-expansion): https://github.com/advisories/GHSA-v6h2-p8h4-qcjw
36
- - Dev dependency audit snapshot: `docs/security-incidents/dev-deps-high.json`
37
- - Prior incident notes:
38
- - `docs/security-incidents/2025-11-17-glob-cli-incident.md`
39
- - `docs/security-incidents/2025-11-18-brace-expansion-redos.md`
40
- - `docs/security-incidents/2025-11-18-bundled-dev-deps-accepted-risk.md`
41
-
42
- **Timeline:**
43
-
44
- - **2025-11-17**: High-severity `glob` and `npm` dev-dependency issues detected via `npm audit` and captured in `dev-deps-high.json`.
45
- - **2025-11-18**: Initial incident markdown files created to document residual risk in bundled dev dependencies within `@semantic-release/npm`.
46
- - **2025-11-23**: Confirmed that no mature, safe upgrade path was available via `dry-aged-deps`; residual risk kept under review.
47
- - **2025-12-03**: Incident converted into a formal `SECURITY-INCIDENT-*.known-error.md` record with explicit compensating controls and linkage to CI/CD configuration.
48
-
49
- **Impact Analysis:**
50
-
51
- - The vulnerable `glob` and `brace-expansion` instances exist exclusively inside the npm CLI bundled with `@semantic-release/npm` and are only used during automated release publishing from CI.
52
- - There is **no** impact on:
53
- - The published eslint plugin runtime (`eslint-plugin-traceability`).
54
- - End-user projects that consume this plugin.
55
- - Production dependency trees (`npm audit --production` reports 0 vulnerabilities).
56
- - Exploitability in this projects context is low because:
57
- - CI workflows do not invoke the `glob` CLI with `-c/--cmd` and do not expose untrusted patterns to the bundled npm CLI.
58
- - The semantic-release job runs in a controlled CI environment with a tightly scoped `NPM_TOKEN` and no untrusted user input.
59
- - The primary risk is limited to the release automation environment, not to downstream users.
60
-
61
- **Compensating Controls:**
62
-
63
- 1. **Environment Isolation**
64
- - The vulnerable tooling is only executed in the `quality-and-deploy` job of `.github/workflows/ci-cd.yml` on pushes to the `main` branch.
65
- - Job-level permissions are scoped to the minimum required for releases (`contents`, `issues`, `pull-requests`, `id-token`). No additional permissions are granted.
66
- - The job runs on GitHub-hosted runners and does not have access to any internal infrastructure.
67
-
68
- 2. **Dependency and Audit Controls**
69
- - `npm audit --omit=dev --audit-level=high` is enforced as part of `npm run ci-verify:full` to ensure production dependencies are free of high-severity issues.
70
- - `npm run audit:dev-high` (via `scripts/generate-dev-deps-audit.js`) continuously records high-severity dev-only vulnerabilities into `ci/npm-audit.json` for review.
71
- - `npm run safety:deps` (via `scripts/ci-safety-deps.js`) runs `dry-aged-deps` to validate that no safe, dry-aged upgrades are currently available; this output is published as a CI artifact.
72
- - `package.json` uses `overrides` to enforce safer versions of many transitive dependencies (e.g., `glob`, `tar`, `http-cache-semantics`, `ip`, `semver`, `socks`) wherever technically possible. These overrides do **not** affect the npm binary bundled within `@semantic-release/npm`, but they reduce the surrounding attack surface.
73
-
74
- 3. **Usage Constraints**
75
- - Project scripts and CI workflows never invoke `glob` with the `-c/--cmd` options, eliminating the known command-injection vector in normal operation.
76
- - The release job does not accept untrusted user input that could influence file patterns or environment variables passed to the bundled npm CLI.
77
-
78
- 4. **Monitoring and Review**
79
- - The nightly `dependency-health` job runs `npm run audit:dev-high` to keep dev-dependency vulnerabilities under continuous review.
80
- - `docs/decisions/adr-accept-dev-dep-risk-glob.md` documents this decision and requires weekly reassessment using the CI audit artifacts.
81
- - Any change in `dev-deps-high.json` that indicates the availability of a patched, dry-aged-safe version of `@semantic-release/npm` or its bundled npm will trigger reevaluation and, if feasible, an upgrade.
82
-
83
- **Testing:**
84
-
85
- - `npm run ci-verify:full` (used in CI and pre-push) validates:
86
- - Build and type-check succeed.
87
- - Linting, duplication, and traceability checks pass.
88
- - Jest test suite (with coverage) passes.
89
- - `npm audit --omit=dev --audit-level=high` passes (production dependencies clean).
90
- - `npm run audit:dev-high` and `npm run safety:deps` complete and publish audit artifacts.
91
- - The semantic-release publishing step is followed, when a new version is published, by `scripts/smoke-test.sh`, which installs the freshly published package in an isolated temp project and validates that the plugin loads correctly. This ensures that any future upgrade of the release toolchain preserves expected behavior.
92
-
93
- **Planned Follow-ups:**
94
-
95
- - Periodically re-run `npm run deps:maturity -- --format=json --check` when updating dev dependencies to identify a safe, vulnerability-free version of `@semantic-release/npm` or an alternative release mechanism.
96
- - When a safe, dry-aged-compatible upgrade path is available, migrate to a newer semantic-release/npm toolchain and retire this known error record by adding a **Resolved** section documenting the change.
97
-
98
- Created autonomously by voder.ai
99
-
100
- ## Relationship to User-Facing Guarantees
101
-
102
- This known error is limited to dev-only release tooling and does not change the security guarantees described in the README and user documentation. The vulnerable `glob` and `brace-expansion` instances are only executed inside GitHub Actions during semantic-release; they are never run when users install or run `eslint-plugin-traceability` or `traceability-maint`.
103
-
104
- The combination of `npm audit --omit=dev --audit-level=high` and `dry-aged-deps` checks is what allows the project to assert that published versions do not ship with known high-severity vulnerabilities in their **production** dependency tree. Because the affected code is confined to CI release automation and excluded from the published runtime dependencies, the security posture promised to end users remains intact.
@@ -1,37 +0,0 @@
1
- # Security Incident Report
2
-
3
- **Date:** YYYY-MM-DD
4
-
5
- **Dependency:** <package name>@<version>
6
-
7
- **Vulnerability ID:** <CVE or GHSA identifier>
8
-
9
- **Severity:** <severity level>
10
-
11
- **Description:**
12
-
13
- A detailed description of the vulnerability, its impact on our project, and any relevant context or references.
14
-
15
- **Remediation:**
16
-
17
- - **Status:** [Patched/Workaround/Monitor/Other]
18
- - **Fixed Version:** <version> (if patched) or describe workaround/monitor plan
19
-
20
- **References:**
21
-
22
- - Link to vulnerability advisory or CVE: <URL>
23
- - Link to any relevant PRs, issues, or documentation: <URL>
24
-
25
- **Timeline:**
26
-
27
- - [Date] Identified vulnerability
28
- - [Date] Decision made to remediate or monitor
29
- - [Date] Applied patch or workaround
30
-
31
- **Impact Analysis:**
32
-
33
- Describe the potential impact of the vulnerability on our project.
34
-
35
- **Testing:**
36
-
37
- Describe any tests or checks added to validate the remediation (e.g., automated audits, dependency pinning).
@@ -1,57 +0,0 @@
1
- # Dependency Override Rationale
2
-
3
- **Date:** 2025-11-18
4
-
5
- This document provides the rationale for each manual dependency override specified in `package.json` under the `overrides` section. Manual overrides bypass the automated recommendation tool (`dry-aged-deps`) and may introduce residual risk; thus, each override is documented with a risk assessment and justification.
6
-
7
- ## glob @ 12.0.0
8
- - **Reason:** Mitigate GHSA-5j98-mcp5-4vw2 (glob CLI command injection) affecting versions 10.3.7–11.0.3 by pinning to 12.0.0 which includes upstream fixes.
9
- - **Role:** Transitive dev-dependency in `@semantic-release/npm`.
10
- - **Risk Assessment:** Residual risk low; dev-only, no production exposure, specific CLI flag not used.
11
- - **Documentation:** See [glob CLI incident](2025-11-17-glob-cli-incident.md).
12
-
13
- ## tar @ >=6.1.12
14
- - **Reason:** Address CVE-2023-47146 (directory traversal) and GHSA-29xp-372q-xqph (race condition) by requiring tar ≥6.1.12.
15
- - **Role:** Transitive dependency for packaging; dev-only.
16
- - **Risk Assessment:** Low; no untrusted archive processing in project.
17
- - **Documentation:** See [tar race condition incident](2025-11-18-tar-race-condition.md).
18
-
19
- ## http-cache-semantics @ >=4.1.1
20
- - **Reason:** Upgrade to version addressing a moderate severity HTTP caching vulnerability.
21
- - **Role:** Transitive dev-dependency in caching libraries.
22
- - **Risk Assessment:** Low; dev-only, isolated impact.
23
- - **References:** https://github.com/advisories/GHSA-rc47-6667-r5fw
24
-
25
- ## ip @ >=2.0.2
26
- - **Reason:** Address vulnerability in the `ip` package (e.g., GHSA-xxxx).
27
- - **Role:** Transitive dev-dependency.
28
- - **Risk Assessment:** Low; dev-only.
29
- - **References:** https://github.com/advisories/GHSA-5jpg-2xvr-rw5w
30
-
31
- ## semver @ >=7.5.2
32
- - **Reason:** Mitigate advisory in `semver` package affecting version parsing (GHSA-xxxx).
33
- - **Role:** Transitive dev-dependency.
34
- - **Risk Assessment:** Low; dev-only.
35
- - **References:** https://github.com/advisories/GHSA-vwqq-5vrc-xw9h
36
-
37
- ## socks @ >=2.7.2
38
- - **Reason:** Upgrade to version addressing security advisory in `socks` package (GHSA-xxxx).
39
- - **Role:** Transitive dev-dependency.
40
- - **Risk Assessment:** Low; dev-only.
41
- - **References:** https://github.com/advisories/GHSA-5v9h-799p-53ph
42
-
43
- ## Mitigation and Next Steps
44
- - Monitor `npm audit` and `dry-aged-deps` recommendations for upstream patches.
45
- - Remove manual overrides when safe versions are released and validated.
46
- - Document any new overrides following the procedure in `handling-procedure.md`.
47
-
48
- ## Relationship to Dev-Dependencies Audit
49
-
50
- The overrides for `glob`, `tar`, `http-cache-semantics`, `ip`, `semver`, and `socks` correspond directly to the accepted-risk items captured in the dev-dependencies audit snapshot (`dev-deps-high.json`). The CI helper script `ci-safety-deps.js` runs `dry-aged-deps` (or a stable fallback when `dry-aged-deps` is unavailable) to generate machine-readable vulnerability reports. These reports, together with `dev-deps-high.json`, are used whenever we reassess and either renew, tighten, or remove these accepted-risk overrides.
51
-
52
- ## Alignment with dry-aged-deps
53
-
54
- - The current manual overrides are layered on top of the `dry-aged-deps` maturity rules: `dry-aged-deps` still runs in CI and informs us of any newer, sufficiently “aged” versions, while overrides define explicit, reviewed exceptions.
55
- - Overrides are only added after `dry-aged-deps` output and security advisories have been reviewed, and they are periodically revalidated against fresh `dry-aged-deps` runs to ensure we are not blocking safe, tool-recommended upgrades.
56
- - As of 2025-12-03, a fresh `npm run deps:maturity -- --format=json --check` run reported `totalOutdated: 0` and `safeUpdates: 0`, confirming that `dry-aged-deps` does not currently recommend newer versions for any of the overridden packages.
57
- - When future `dry-aged-deps` runs begin to report non-zero `safeUpdates` for these packages, we will reassess each override, prefer tool-aligned upgrades where feasible, and remove or narrow overrides once upgraded versions are validated.
@@ -1,116 +0,0 @@
1
- {
2
- "auditReportVersion": 2,
3
- "vulnerabilities": {
4
- "brace-expansion": {
5
- "name": "brace-expansion",
6
- "severity": "low",
7
- "isDirect": false,
8
- "via": [
9
- {
10
- "source": 1105443,
11
- "name": "brace-expansion",
12
- "dependency": "brace-expansion",
13
- "title": "brace-expansion Regular Expression Denial of Service vulnerability",
14
- "url": "https://github.com/advisories/GHSA-v6h2-p8h4-qcjw",
15
- "severity": "low",
16
- "cwe": [
17
- "CWE-400"
18
- ],
19
- "cvss": {
20
- "score": 3.1,
21
- "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L"
22
- },
23
- "range": ">=1.0.0 <=1.1.11"
24
- },
25
- {
26
- "source": 1105444,
27
- "name": "brace-expansion",
28
- "dependency": "brace-expansion",
29
- "title": "brace-expansion Regular Expression Denial of Service vulnerability",
30
- "url": "https://github.com/advisories/GHSA-v6h2-p8h4-qcjw",
31
- "severity": "low",
32
- "cwe": [
33
- "CWE-400"
34
- ],
35
- "cvss": {
36
- "score": 3.1,
37
- "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L"
38
- },
39
- "range": ">=2.0.0 <=2.0.1"
40
- }
41
- ],
42
- "effects": [],
43
- "range": "1.0.0 - 1.1.11 || 2.0.0 - 2.0.1",
44
- "nodes": [
45
- "node_modules/@semantic-release/npm/node_modules/npm/node_modules/brace-expansion",
46
- "node_modules/@semantic-release/npm/node_modules/npm/node_modules/node-gyp/node_modules/brace-expansion",
47
- "node_modules/@semantic-release/npm/node_modules/npm/node_modules/node-gyp/node_modules/cacache/node_modules/brace-expansion",
48
- "node_modules/@semantic-release/npm/node_modules/npm/node_modules/rimraf/node_modules/brace-expansion"
49
- ],
50
- "fixAvailable": true
51
- },
52
- "glob": {
53
- "name": "glob",
54
- "severity": "high",
55
- "isDirect": false,
56
- "via": [
57
- {
58
- "source": 1109842,
59
- "name": "glob",
60
- "dependency": "glob",
61
- "title": "glob CLI: Command injection via -c/--cmd executes matches with shell:true",
62
- "url": "https://github.com/advisories/GHSA-5j98-mcp5-4vw2",
63
- "severity": "high",
64
- "cwe": [
65
- "CWE-78"
66
- ],
67
- "cvss": {
68
- "score": 7.5,
69
- "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H"
70
- },
71
- "range": ">=10.2.0 <10.5.0"
72
- }
73
- ],
74
- "effects": [
75
- "npm"
76
- ],
77
- "range": "10.2.0 - 10.4.5",
78
- "nodes": [
79
- "node_modules/@semantic-release/npm/node_modules/npm/node_modules/glob"
80
- ],
81
- "fixAvailable": true
82
- },
83
- "npm": {
84
- "name": "npm",
85
- "severity": "high",
86
- "isDirect": false,
87
- "via": [
88
- "glob"
89
- ],
90
- "effects": [],
91
- "range": "7.21.0 - 8.5.4 || 9.6.6 - 11.6.0",
92
- "nodes": [
93
- "node_modules/@semantic-release/npm/node_modules/npm"
94
- ],
95
- "fixAvailable": true
96
- }
97
- },
98
- "metadata": {
99
- "vulnerabilities": {
100
- "info": 0,
101
- "low": 1,
102
- "moderate": 0,
103
- "high": 2,
104
- "critical": 0,
105
- "total": 3
106
- },
107
- "dependencies": {
108
- "prod": 1,
109
- "dev": 1066,
110
- "optional": 33,
111
- "peer": 0,
112
- "peerOptional": 0,
113
- "total": 1066
114
- }
115
- }
116
- }