Fix Dependabot and CodeQL alerts; stop duplicate cursor PRs - #354
Conversation
Drop image-size (no patched npm release) in favor of a JPEG/PNG/WebP parser, bump sanitize-html, PostCSS, and brace-expansion, replace the polynomial markup regexes with a linear scan, and strip CR/LF from CSP and Stripe log lines. Ignore cursor/* in the feature-to-dev auto-PR workflow so github-actions does not open a second review. Co-authored-by: Aamogh <aamoghS@users.noreply.github.com>
Dependency ReviewThe following issues were found:
License Issuessites/mainweb/package.json
OpenSSF Scorecard
Scanned Files
|
|
Visit the preview URL for this PR (updated for commit 2e77f1c): https://hacklytics2027--pr-354-8u40146i.web.app (expires Sun, 23 Aug 2026 15:44:16 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c48ba34db61581e25fe2978355160b5eefe0e83f |
| const forLog = body | ||
| .slice(0, MAX_REPORT_BYTES) | ||
| .replace(/[\n\r]/g, " "); | ||
| console.warn("[CSP] violation report:", forLog); |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2e77f1c. Configure here.
| if (!isHtmlSpace(prev) && prev !== "<") { | ||
| pos = on + 1; | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Handler check misses slash separators
High Severity
hasInlineHandler only treats HTML whitespace and < as valid characters before on…=, but browsers also accept / and a closing quote as attribute boundaries. Payloads like `<div/onerror=…>` or `<body/onload=…>` that the old regex rejected now pass hasDangerousMarkup, including for tags not in DANGEROUS_TAGS.
Reviewed by Cursor Bugbot for commit 2e77f1c. Configure here.
|
| Filename | Overview |
|---|---|
| packages/api/src/services/image-dimensions.ts | Adds bounded parsers for the three supported image formats without exposing a concrete regression. |
| packages/api/src/routers/user.ts | Replaces the vulnerable image-size call with the new parser while retaining type and dimension limits. |
| packages/api/src/trpc.ts | Replaces vulnerable regular expressions with linear markup scanning; one grammar difference was found but has no reachable raw-HTML consequence in current callers. |
| sites/mainweb/app/(portal)/api/webhooks/stripe/route.ts | Restricts Stripe failure logs to sanitized identifiers and exception names. |
| sites/mainweb/app/api/csp-report/route.ts | Removes CR and LF characters from unauthenticated CSP reports before logging. |
| .github/workflows/feature-to-dev-pr.yml | Excludes Cursor-created branches from automatic development-target PR creation. |
| pnpm-lock.yaml | Resolves the intended patched dependency versions and removes image-size. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Profile image data URI] --> B[Decode bounded base64]
B --> C[Read PNG JPEG or WebP dimensions]
C --> D{Valid and at most 2000x2000?}
D -- Yes --> E[Persist profile image]
D -- No --> F[Reject request]
Reviews (1): Last reviewed commit: "Fix Dependabot and CodeQL alerts; stop d..." | Re-trigger Greptile


Closes the extra github-actions PR noise and the open Dependabot / CodeQL findings on
main.PR hygiene
dev).feature-to-dev-pr.ymlnow ignorescursor/**, so cloud-agent branches only keep the human-owned PR intomain(reviewer remainsaamoghSvia CODEOWNERS). Docs stay on #352.Dependabot alerts
image-sizeICNS / JXL / HEIF infinite loops (#268–#272)image-size(no patched 2.0.3 on npm). Profile uploads now use a JPEG/PNG/WebP-only parser.sanitize-htmljavascript: URIs (#262–#263)2.17.4→2.17.5sourceMappingURLwhenfromis unset (#265–#267)8.5.18→8.5.23(direct deps + pnpm override)brace-expansionintermediate-array DoS (#264)5.0.8→5.0.9CodeQL
trpc.tson*=/javascript:(same reject-not-rewrite behaviour; existing sanitizer tests pass)console.warnError.nameonly, not the raw exceptionpnpm test: 514 passed.