Skip to content

fix(security): resolve vulnerable dependencies (security audit #12) - #2869

Open
hanapotski wants to merge 2 commits into
developfrom
claude/security-audit-issue-12-80f9fe
Open

fix(security): resolve vulnerable dependencies (security audit #12)#2869
hanapotski wants to merge 2 commits into
developfrom
claude/security-audit-issue-12-80f9fe

Conversation

@hanapotski

Copy link
Copy Markdown
Contributor

Summary

Resolves item #12 (Vulnerable dependencies) from the security audit. Brings both npm workspaces to a clean npm audit:

  • server: 34 → 0 vulnerabilities (was 1 critical, 3 high, 26 moderate, 4 low)
  • client: 6 → 0 vulnerabilities (was 6 high)

Changes

client/

  • npm audit fix only (all non-breaking, lockfile-only): brace-expansion, form-data, js-yaml, postcss, and react-router (7.18.1 → 7.18.2, an in-range patch — no --force/major bump needed).

server/

  • npm audit fix (non-breaking): fast-xml-parser (the critical one), js-yaml, uuid, and the AWS SDK / @smithy cluster.
  • Removed massive (unused dead code) — it pulled in a vulnerable lodash and an outdated pg-promise.
  • Declared pg-promise@^11.15.0 as a direct dependency. It had been a phantom dependency: app/services/db.ts imports pg-promise directly, but it was only present transitively via massive. Removing massive required declaring it properly.
  • Removed mocha and its only consumer, the orphaned/un-run server/test/test_neighborhood_service.ts — it pulled in a vulnerable serialize-javascript.
  • aws-service.ts: sourced the Cognito identity-pool credential helper from the already-declared @aws-sdk/credential-providers meta-package instead of the standalone @aws-sdk/credential-provider-cognito-identity (two more phantom deps that had been resolving transitively and had fallen behind the rest of the SDK). Behavior-preserving — same identity pool, same us-west-2 region.

Verification

Check server client
npm audit 0 vulns ✅ 0 vulns ✅
typecheck PASS ✅ PASS ✅
build PASS ✅ PASS ✅
lint PASS ✅ (pre-existing broken config, unrelated)
Jest baseline unchanged — 10 pre-existing account snapshot failures, 0 new

Also load-smoke-tested the built db.js (pg-promise 11 initializes cleanly) and aws-service.js.

Note for reviewers

The AWS Cognito/Location autocomplete path can't be exercised at runtime without live AWS credentials + IDENTITY_POOL_ID/PLACE_INDEX_NAME. Typecheck and module-load confirm the API shape, but a live smoke test of address autocomplete in a dev environment before merge would be prudent.


🤖 Written by Claude on behalf of @hanapotski

Generated with Claude Code

Clears all npm audit findings in both workspaces (server 34 -> 0,
client 6 -> 0).

client/
- npm audit fix (non-breaking): brace-expansion, form-data, js-yaml,
  postcss, react-router (7.18.1 -> 7.18.2, in-range patch).

server/
- npm audit fix (non-breaking): fast-xml-parser (critical), js-yaml,
  uuid, and the AWS SDK / smithy cluster.
- Remove unused `massive` (dead code) which pulled in vulnerable lodash
  and an outdated pg-promise; declare `pg-promise@^11.15.0` directly
  (it was previously an undeclared transitive dependency of massive
  even though db.ts imports it directly).
- Remove `mocha` and its only consumer, the orphaned, un-run
  test/test_neighborhood_service.ts, which pulled in vulnerable
  serialize-javascript.
- aws-service.ts: source the Cognito-pool credential helper from the
  already-declared @aws-sdk/credential-providers meta-package instead of
  the standalone @aws-sdk/credential-provider-cognito-identity, which had
  fallen behind the rest of the SDK. Behavior-preserving (same identity
  pool, same us-west-2 region).

Verified: both workspaces `npm audit` clean; server + client typecheck
and build pass; server lint passes; server Jest baseline unchanged
(10 pre-existing account snapshot failures, no new failures).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@SAUMILDHANKAR
SAUMILDHANKAR self-requested a review September 1, 2026 02:18
…ge-conflict-a64d25

# Conflicts:
#	server/package-lock.json
@SAUMILDHANKAR

SAUMILDHANKAR commented Sep 2, 2026

Copy link
Copy Markdown
Member
```npm audit --production``` in server (for reference while reviewing in dev branch)

npm audit report

fast-uri 3.0.0 - 3.1.5
Severity: high
fast-uri vulnerable to host confusion via skipped IDN canonicalization on scheme-relative references - GHSA-5jgf-p345-68v8
fast-uri vulnerable to server-side request forgery via malformed IPv6 normalization - GHSA-f65p-4m7j-42xc
fast-uri vulnerable to server-side request forgery via repeated hostname percent-decoding - GHSA-fph4-wmhf-6fwf
fast-uri vulnerable to host confusion via percent-encoded scheme normalization - GHSA-jqff-g426-hqxp
fix available via npm audit fix
node_modules/fast-uri

fast-xml-parser <=5.6.0
Severity: critical
fast-xml-parser has RangeError DoS Numeric Entities Bug - GHSA-37qj-frw5-hhjh
fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names - GHSA-m7jm-9gc2-mpf2
fast-xml-parser affected by DoS through entity expansion in DOCTYPE (no expansion limit) - GHSA-jmr7-xgp7-cmfj
fast-xml-parser has stack overflow in XMLBuilder with preserveOrder - GHSA-fj3w-jwp8-x2g3
fast-xml-parser affected by numeric entity expansion bypassing all entity expansion limits (incomplete fix for CVE-2026-26278) - GHSA-8gc5-j5rx-235r
Entity Expansion Limits Bypassed When Set to Zero Due to JavaScript Falsy Evaluation in fast-xml-parser - GHSA-jp2q-39xq-3w4g
fast-xml-parser XMLBuilder: XML Comment and CDATA Injection via Unescaped Delimiters - GHSA-gh4j-gqv2-49f6
fix available via npm audit fix
node_modules/@aws-sdk/client-ses/node_modules/fast-xml-parser
@aws-sdk/xml-builder 3.894.0 - 3.972.18
Depends on vulnerable versions of fast-xml-parser
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/xml-builder
@aws-sdk/core 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/xml-builder
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/core
@aws-sdk/client-ses 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/credential-provider-node
Depends on vulnerable versions of @aws-sdk/middleware-user-agent
Depends on vulnerable versions of @aws-sdk/util-user-agent-node
node_modules/@aws-sdk/client-ses
@aws-sdk/client-sso 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/middleware-user-agent
Depends on vulnerable versions of @aws-sdk/util-user-agent-node
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/client-sso
@aws-sdk/credential-provider-env 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-env
@aws-sdk/credential-provider-node 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/credential-provider-env
Depends on vulnerable versions of @aws-sdk/credential-provider-http
Depends on vulnerable versions of @aws-sdk/credential-provider-ini
Depends on vulnerable versions of @aws-sdk/credential-provider-process
Depends on vulnerable versions of @aws-sdk/credential-provider-sso
Depends on vulnerable versions of @aws-sdk/credential-provider-web-identity
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-node
@aws-sdk/credential-provider-http 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-http
@aws-sdk/credential-provider-ini 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/credential-provider-env
Depends on vulnerable versions of @aws-sdk/credential-provider-http
Depends on vulnerable versions of @aws-sdk/credential-provider-login
Depends on vulnerable versions of @aws-sdk/credential-provider-process
Depends on vulnerable versions of @aws-sdk/credential-provider-sso
Depends on vulnerable versions of @aws-sdk/credential-provider-web-identity
Depends on vulnerable versions of @aws-sdk/nested-clients
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-ini
@aws-sdk/credential-provider-login <=3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/nested-clients
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-login
@aws-sdk/credential-provider-process 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-process
@aws-sdk/credential-provider-sso 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/client-sso
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/token-providers
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-sso
@aws-sdk/credential-provider-web-identity 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/nested-clients
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-web-identity
@aws-sdk/middleware-user-agent 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/middleware-user-agent
@aws-sdk/util-user-agent-node 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/middleware-user-agent
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/util-user-agent-node
@aws-sdk/nested-clients 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/middleware-user-agent
Depends on vulnerable versions of @aws-sdk/util-user-agent-node
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/nested-clients
@aws-sdk/token-providers 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/nested-clients
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/token-providers

js-yaml 4.0.0 - 4.3.0
Severity: high
JS-YAML: Quadratic-complexity DoS in merge key handling via repeated aliases - GHSA-h67p-54hq-rp68
js-yaml: YAML merge-key chains can force quadratic CPU consumption - GHSA-52cp-r559-cp3m
JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026-59870 fix not backported - GHSA-5p4m-2wfm-xmqj
fix available via npm audit fix
node_modules/js-yaml

lodash <=4.17.23
Severity: high
lodash vulnerable to Code Injection via _.template imports key names - GHSA-r5fr-rjxr-66jc
lodash vulnerable to Prototype Pollution via array path bypass in _.unset and _.omit - GHSA-f23m-r3pf-42rh
Lodash has Prototype Pollution Vulnerability in _.unset and _.omit functions - GHSA-xxjr-mmjv-4gpg
fix available via npm audit fix --force
Will install massive@4.8.3, which is a breaking change
node_modules/lodash
massive >=3.0.0-rc1
Depends on vulnerable versions of lodash
Depends on vulnerable versions of pg-promise
node_modules/massive

pg-promise <11.5.5
Severity: moderate
pg-promise SQL Injection vulnerability - GHSA-ff9h-848c-4xfj
fix available via npm audit fix --force
Will install massive@4.8.3, which is a breaking change
node_modules/pg-promise

qs 2.2.5 - 6.15.3
Severity: moderate
qs array-limit bypass via bracket-key comma parsing - GHSA-x5fp-wj9c-mxmx
qs: Denial of Service via Attacker Controlled isBuffer - GHSA-4mjr-xmp4-gh2g
fix available via npm audit fix
node_modules/qs

serialize-javascript <=7.0.4
Severity: high
Serialize JavaScript is Vulnerable to RCE via RegExp.flags and Date.prototype.toISOString() - GHSA-5c6j-r48x-rmvq
Serialize JavaScript has CPU Exhaustion Denial of Service via crafted array-like objects - GHSA-qj8w-gfj5-8c6v
fix available via npm audit fix --force
Will install mocha@12.0.0, which is a breaking change
node_modules/serialize-javascript
mocha 8.2.0 - 11.8.0
Depends on vulnerable versions of serialize-javascript
node_modules/mocha

25 vulnerabilities (20 moderate, 4 high, 1 critical)

To address issues that do not require attention, run:
npm audit fix

To address all issues (including breaking changes), run:
npm audit fix --force

```npm audit --production``` in server (in pr branch)

npm audit report

fast-uri 3.0.0 - 3.1.5
Severity: high
fast-uri vulnerable to host confusion via skipped IDN canonicalization on scheme-relative references - GHSA-5jgf-p345-68v8
fast-uri vulnerable to server-side request forgery via malformed IPv6 normalization - GHSA-f65p-4m7j-42xc
fast-uri vulnerable to server-side request forgery via repeated hostname percent-decoding - GHSA-fph4-wmhf-6fwf
fast-uri vulnerable to host confusion via percent-encoded scheme normalization - GHSA-jqff-g426-hqxp
fix available via npm audit fix
node_modules/fast-uri

fast-xml-parser <=5.6.0
Severity: critical
fast-xml-parser has RangeError DoS Numeric Entities Bug - GHSA-37qj-frw5-hhjh
fast-xml-parser has an entity encoding bypass via regex injection in DOCTYPE entity names - GHSA-m7jm-9gc2-mpf2
fast-xml-parser affected by DoS through entity expansion in DOCTYPE (no expansion limit) - GHSA-jmr7-xgp7-cmfj
fast-xml-parser has stack overflow in XMLBuilder with preserveOrder - GHSA-fj3w-jwp8-x2g3
fast-xml-parser affected by numeric entity expansion bypassing all entity expansion limits (incomplete fix for CVE-2026-26278) - GHSA-8gc5-j5rx-235r
Entity Expansion Limits Bypassed When Set to Zero Due to JavaScript Falsy Evaluation in fast-xml-parser - GHSA-jp2q-39xq-3w4g
fast-xml-parser XMLBuilder: XML Comment and CDATA Injection via Unescaped Delimiters - GHSA-gh4j-gqv2-49f6
fix available via npm audit fix
node_modules/@aws-sdk/client-ses/node_modules/fast-xml-parser
@aws-sdk/xml-builder 3.894.0 - 3.972.18
Depends on vulnerable versions of fast-xml-parser
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/xml-builder
@aws-sdk/core 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/xml-builder
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/core
@aws-sdk/client-ses 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/credential-provider-node
Depends on vulnerable versions of @aws-sdk/middleware-user-agent
Depends on vulnerable versions of @aws-sdk/util-user-agent-node
node_modules/@aws-sdk/client-ses
@aws-sdk/client-sso 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/middleware-user-agent
Depends on vulnerable versions of @aws-sdk/util-user-agent-node
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/client-sso
@aws-sdk/credential-provider-env 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-env
@aws-sdk/credential-provider-http 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-http
@aws-sdk/credential-provider-node 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/credential-provider-env
Depends on vulnerable versions of @aws-sdk/credential-provider-http
Depends on vulnerable versions of @aws-sdk/credential-provider-ini
Depends on vulnerable versions of @aws-sdk/credential-provider-process
Depends on vulnerable versions of @aws-sdk/credential-provider-sso
Depends on vulnerable versions of @aws-sdk/credential-provider-web-identity
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-node
@aws-sdk/credential-provider-ini 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/credential-provider-env
Depends on vulnerable versions of @aws-sdk/credential-provider-http
Depends on vulnerable versions of @aws-sdk/credential-provider-login
Depends on vulnerable versions of @aws-sdk/credential-provider-process
Depends on vulnerable versions of @aws-sdk/credential-provider-sso
Depends on vulnerable versions of @aws-sdk/credential-provider-web-identity
Depends on vulnerable versions of @aws-sdk/nested-clients
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-ini
@aws-sdk/credential-provider-login <=3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/nested-clients
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-login
@aws-sdk/credential-provider-process 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-process
@aws-sdk/credential-provider-sso 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/client-sso
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/token-providers
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-sso
@aws-sdk/credential-provider-web-identity 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/nested-clients
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/credential-provider-web-identity
@aws-sdk/middleware-user-agent 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/middleware-user-agent
@aws-sdk/util-user-agent-node 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/middleware-user-agent
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/util-user-agent-node
@aws-sdk/nested-clients 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/middleware-user-agent
Depends on vulnerable versions of @aws-sdk/util-user-agent-node
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/nested-clients
@aws-sdk/token-providers 3.894.0 - 3.972.0
Depends on vulnerable versions of @aws-sdk/core
Depends on vulnerable versions of @aws-sdk/nested-clients
node_modules/@aws-sdk/client-ses/node_modules/@aws-sdk/token-providers

qs 2.2.5 - 6.15.3
Severity: moderate
qs array-limit bypass via bracket-key comma parsing - GHSA-x5fp-wj9c-mxmx
qs: Denial of Service via Attacker Controlled isBuffer - GHSA-4mjr-xmp4-gh2g
fix available via npm audit fix
node_modules/qs

19 vulnerabilities (17 moderate, 1 high, 1 critical)

To address all issues, run:
npm audit fix

@SAUMILDHANKAR SAUMILDHANKAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude teaches me that after the merge commit, fast-xml-parser version was reverted, so npm audit --production still shows critical vulnerability. Another ``npm audit fix``` commit resolves that one atleast.

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.

2 participants