fix: resolve SonarQube findings and high-severity npm audit vulnerability
SonarQube dev scan (localhost:9000, project max-app) flagged 2 bugs, 6 vulnerabilities and 3 code smells; quality gate now passes. - visionCapture.ts: .sort() without a compare function relied on locale- dependent default ordering — fixed with localeCompare. - index.html: added missing lang="fr" on <html>; documented why style-src keeps 'unsafe-inline' (React/mermaid inline styles) while script-src stays strictly 'self'. - drawingWindow.ts/exerciseWindow.ts/windowBridge.ts: replaced Math.random() with crypto.randomUUID() for IPC correlation ids (flagged as insecure PRNG, even though these ids are never security-sensitive). - translate.ts/deleteFileOrFolder.ts: replaced two regexes flagged for superlinear backtracking with plain indexOf/loop-based equivalents. - App.tsx: documented with NOSONAR why the whole-window drag surface isn't given fake keyboard interactivity (no keyboard gesture equivalent to "drag the window"; would also break tab order). - drawingWindow.ts: extracted the near-identical request/ack/timeout boilerplate shared by revealShape() and playCaption() into waitForAck(), fixing a new-code duplication-density quality gate failure surfaced once these lines were touched. Also fixes the Gitea CI "Security audit" step (npm audit --audit-level=high): pptxgenjs@4.0.1 pinned image-size to ^1.2.1, within the high-severity DoS range (GHSA-5p2g-fcmc-qvqq / GHSA-w3rx-r6r6-pgpr, affects <=2.0.2). Added an npm "overrides" entry forcing image-size to ^2.0.4 under pptxgenjs. The affected code path (image embedding) isn't even used by createPowerpoint.ts, and existing tests still pass. Remaining audit findings are all moderate, dev-tooling-only (eslint/electron-builder's minimatch/glob chain). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
a771883bf5
commit
09ae70cb36
@@ -27,6 +27,11 @@
|
||||
"test:e2e": "npm run build && playwright test",
|
||||
"prepare": "husky"
|
||||
},
|
||||
"overrides": {
|
||||
"pptxgenjs": {
|
||||
"image-size": "^2.0.4"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{ts,tsx}": [
|
||||
"node node_modules/eslint/bin/eslint.js --fix",
|
||||
|
||||
Reference in New Issue
Block a user