fix(security): resolve code-scanning + dependency alerts - #22
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Handling the open code-scanning (CodeQL) and Dependabot alerts.
Fixed (real)
webhook.js(js/reflected-xss): the Meta verify handler echoedhub.challengeviares.send()(defaults totext/html). Now sent astext/plain, so the reflected value can't be interpreted as HTML. (Meta's challenge is numeric; only echoed after a verify-token match.)WhatsAppPreview.jsx(js/xss-through-dom): the template-builder preview link used the admin's typed URL directly ashref. Now onlyhttp(s)URLs are allowed, neutralising ajavascript:scheme.uuid(Dependabot +npm audit):exceljs@4.4.0pulleduuid@8.3.2(GHSA buffer-bounds,<11.1.1). Added an npmoverridesforcinguuid ^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
mainjs/insecure-randomnessinusers.js(×2) — fixed in fix(security): CSPRNG password gen + gate /uploads behind auth (P1 lows) #15 (crypto.randomInt)js/clear-text-loggingof admin password — fixed in fix(security,config): harden secret guards, scrub Caddyfile, fix deploy docs (Batch D) #5 (written to 0600 file, not logged)False positives / accepted (will dismiss with reasons after merge)
ChatWindow.jsx<img/video src>— the src is ablob:URL fromURL.createObjectURL(not untrusted HTML).auth.js"clear-text storage" of the JWT — a JWT in an httpOnly cookie is the intended session mechanism.index.jscookie CSRF — mitigated bysameSite: 'strict'(cookie not sent cross-site).Verification
node --check✓; backendnpm test20/20 ✓; frontend build ✓ +test:unit51/51 ✓npm audit→ 0 vulnerabilities