Skip to content

fix(security): resolve code-scanning + dependency alerts - #22

Merged
sathyaprakash000 merged 1 commit into
mainfrom
fix/security-scan-findings
May 25, 2026
Merged

fix(security): resolve code-scanning + dependency alerts#22
sathyaprakash000 merged 1 commit into
mainfrom
fix/security-scan-findings

Conversation

@sathyaprakash000

@sathyaprakash000 sathyaprakash000 commented May 25, 2026

Copy link
Copy Markdown
Contributor

What & why

Handling the open code-scanning (CodeQL) and Dependabot alerts.

Fixed (real)

  • Reflected XSS — webhook.js (js/reflected-xss): the Meta verify handler echoed hub.challenge via res.send() (defaults to text/html). Now sent as text/plain, so the reflected value can't be interpreted as HTML. (Meta's challenge is numeric; only echoed after a verify-token match.)
  • DOM XSS — WhatsAppPreview.jsx (js/xss-through-dom): the template-builder preview link used the admin's typed URL directly as href. Now only http(s) URLs are allowed, neutralising a javascript: scheme.
  • Vulnerable uuid (Dependabot + npm audit): exceljs@4.4.0 pulled uuid@8.3.2 (GHSA buffer-bounds, <11.1.1). Added an npm overrides forcing uuid ^11.1.1. Verified exceljs still writes valid xlsx with uuid 11; npm audit (backend) now reports 0 vulnerabilities.

Already fixed earlier — will auto-close on the next CodeQL scan of main

False positives / accepted (will dismiss with reasons after merge)

  • ChatWindow.jsx <img/video src> — the src is a blob: URL from URL.createObjectURL (not untrusted HTML).
  • auth.js "clear-text storage" of the JWT — a JWT in an httpOnly cookie is the intended session mechanism.
  • index.js cookie CSRF — mitigated by sameSite: 'strict' (cookie not sent cross-site).

Verification

  • node --check ✓; backend npm test 20/20 ✓; frontend build ✓ + test:unit 51/51 ✓
  • backend npm audit → 0 vulnerabilities

- webhook.js: echo the Meta verify challenge as text/plain (not res.send's
  text/html default) so the reflected value can't be interpreted as HTML
  (CodeQL js/reflected-xss).
- WhatsAppPreview.jsx: only allow http(s) URLs in the preview link href,
  neutralising a javascript: scheme (CodeQL js/xss-through-dom).
- backend: add an npm override forcing uuid ^11.1.1 (exceljs pulled the
  vulnerable uuid 8.3.2 — GHSA buffer-bounds). exceljs verified working with
  uuid 11; `npm audit` now reports 0 vulnerabilities. Clears the open
  Dependabot alert.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: KingArthur000 <sathyaprakashelango@gmail.com>
@sathyaprakash000
sathyaprakash000 merged commit c583087 into main May 25, 2026
11 checks passed
@sathyaprakash000
sathyaprakash000 deleted the fix/security-scan-findings branch May 25, 2026 05:17
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