Skip to content

Security Wave 1 - supply-chain remediation (-34 vulns)#122

Merged
dev-mansonthomas merged 6 commits into
masterfrom
security/wave-1-supply-chain
May 15, 2026
Merged

Security Wave 1 - supply-chain remediation (-34 vulns)#122
dev-mansonthomas merged 6 commits into
masterfrom
security/wave-1-supply-chain

Conversation

@dev-mansonthomas
Copy link
Copy Markdown
Owner

Security Wave 1 - supply-chain remediation

Implementation of Wave 1 from docs/security-audit-redquest.md. Focus is supply-chain hygiene: no breaking change, no --force npm audit fix, no Angular upgrade.

Net impact

Severity Before After Delta
Critical 6 4 -2 (-33 %)
High 83 67 -16 (-19 %)
Moderate 71 62 -9 (-13 %)
Low 21 14 -7 (-33 %)
Total 181 147 -34 (-19 %)

Baselines committed for diff: docs/security-baseline-2026-05-15.json (before) and docs/security-baseline-2026-05-15-post-wave1.json (after).

Commits

  1. chore(security): snapshot npm audit baseline before Wave 1 fixes - pre-fix audit JSON for auditability.
  2. fix(security): npm audit fix - resolve 20 transitive vulnerabilities - lockfile-only update, no package.json change, no breaking change.
  3. fix(security): remove unused firebase-admin server-side SDK - confirmed zero imports in src/, vendor bundle hash unchanged before/after (23b84eb0b09e489158c2).
  4. chore(security): pin exact versions for firebase and @angular/fire - replace ^ with exact versions.
  5. docs(readme): document npm ci as preferred install for CI and deploys.
  6. chore(security): snapshot post-Wave 1 audit baseline and update plan - final JSON + delta table + Wave 1 flagged complete.

Verification

For every change touching the dependency tree:

  • ng build --configuration dev: green (same vendor bundle hash before/after firebase-admin removal).
  • ng test --watch=false --browsers=ChromeHeadless: 13/13 passing (38 skipped, identical to pre-Wave 1 baseline).
  • npm ls firebase-admin after removal: empty.
  • npm audit JSON snapshots committed before and after for delta auditability.

Out of scope (intentional)

  • Breaking-change fixes requested by npm audit fix --force (would pull Angular 21, karma 6, protractor 6). These belong to a dedicated Angular major upgrade decision.
  • dot-prop and elliptic still use >= ranges in package.json. Flagged in docs/security-audit-redquest.md for a follow-up.
  • Waves 2-5 (secrets/auth audit, security headers/CSP, CI workflow, branch protection): separate PRs per the audit plan.

Rollback plan

Each commit is independently revertible. The two most impactful commits are #3 (firebase-admin removal) and #2 (npm audit fix). If a downstream issue is discovered:

  • git revert <sha> on the offending commit.
  • Or revert the merge commit; lockfile/manifest go back to pre-Wave 1 state.
    No data migration, no runtime contract change.

Related


Pull Request opened by Augment Code with guidance from the PR author

Capture the current vulnerability state (181 issues: 6 critical, 83 high, 71 moderate, 21 low) before running 'npm audit fix' so the diff is auditable in a follow-up commit.
Apply 'npm audit fix' without --force. Only package-lock.json is modified; no package.json change, no breaking change introduced.

Vulnerability count: 181 -> 161 (-20).

  Critical: 6 -> 4 (-2)

  High:     83 -> 73 (-10)

  Moderate: 71 -> 66 (-5)

  Low:      21 -> 18 (-3)

Build (ng build --configuration dev): green. Karma suite: 13/13 passing (38 skipped, identical to pre-fix baseline).

Remaining 161 vulnerabilities require breaking-change upgrades (Angular 21, karma 6, protractor 6) and are intentionally left out of this PR; they will be addressed in a dedicated Angular major upgrade decision.
firebase-admin is a Node.js server SDK; it has no place in an Angular front-end and was never imported anywhere in src/. Its presence pulled in a large transitive subtree (@google-cloud/firestore, @grpc/proto-loader, protobufjs, jsonwebtoken, ...) carrying multiple critical/high CVEs that were structurally unfixable in this client.

Verification: 'grep -rn firebase-admin src/' returns no matches.

Vulnerability count after removal: 161 -> 147 (-14).

Build hash unchanged (vendor bundle 23b84eb0b09e489158c2 identical before/after), confirming the package never reached the bundle. Karma suite still green (13/13).
Replace caret ranges ('^8.10.1', '^6.1.5') with exact versions ('8.10.1', '6.1.5') in package.json for runtime-sensitive Firebase dependencies.

Rationale: 'npm install' without a lockfile (or after lockfile invalidation) would otherwise be free to pull a newer minor of these packages. For supply-chain hardening, pinning to the exact resolved version makes installs deterministic and removes one degree of freedom from the install plan. The package-lock.json already enforced this in 'npm ci' mode, but the manifest now matches.

Build green, Karma suite 13/13 passing, audit count unchanged (147).
Promote 'npm ci' over 'npm install' for any non-interactive environment (CI, deploy, fresh clone). 'npm ci' refuses to mutate package-lock.json and fails fast on lockfile drift, which is the property we want for supply-chain hygiene.
- docs/security-baseline-2026-05-15-post-wave1.json: final 'npm audit' state after Wave 1 commits (147 vulns: 4 critical, 67 high, 62 moderate, 14 low).

- docs/security-audit-redquest.md: mark Wave 1 as complete with the delta table and flag two side findings ('dot-prop' and 'elliptic' use '>=' ranges, more permissive than '^') to schedule in a follow-up.

Net Wave 1 impact: 181 -> 147 vulns (-34, -19%). Critical -33%, Low -33%, no breaking changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant