Skip to content

Fix Dependabot and CodeQL alerts; stop duplicate cursor PRs - #354

Closed
aamoghS wants to merge 1 commit into
mainfrom
cursor/security-alerts-5089
Closed

Fix Dependabot and CodeQL alerts; stop duplicate cursor PRs#354
aamoghS wants to merge 1 commit into
mainfrom
cursor/security-alerts-5089

Conversation

@aamoghS

@aamoghS aamoghS commented Aug 16, 2026

Copy link
Copy Markdown
Member

Closes the extra github-actions PR noise and the open Dependabot / CodeQL findings on main.

PR hygiene

  • Closed #353 (bot PR of the docs branch into dev).
  • feature-to-dev-pr.yml now ignores cursor/**, so cloud-agent branches only keep the human-owned PR into main (reviewer remains aamoghS via CODEOWNERS). Docs stay on #352.

Dependabot alerts

Alert Fix
image-size ICNS / JXL / HEIF infinite loops (#268#272) Removed image-size (no patched 2.0.3 on npm). Profile uploads now use a JPEG/PNG/WebP-only parser.
sanitize-html javascript: URIs (#262#263) 2.17.42.17.5
PostCSS sourceMappingURL when from is unset (#265#267) 8.5.188.5.23 (direct deps + pnpm override)
brace-expansion intermediate-array DoS (#264) override 5.0.85.0.9

CodeQL

Alert Fix
#804 / #805 polynomial regex on trpc.ts Linear scan for dangerous tags / on*= / javascript: (same reject-not-rewrite behaviour; existing sanitizer tests pass)
#806 CSP log injection Strip CR/LF before console.warn
#802 / #803 Stripe log injection Log a newline-stripped id and Error.name only, not the raw exception

pnpm test: 514 passed.

Open in Web Open in Cursor 

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>
@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Aug 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 1 package(s) with unknown licenses.
See the Details below.

License Issues

sites/mainweb/package.json

PackageVersionLicenseIssue Type
sanitize-html^2.17.5NullUnknown License

OpenSSF Scorecard

PackageVersionScoreDetails
npm/sanitize-html 2.17.5 🟢 6.4
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Packaging⚠️ -1packaging workflow not detected
Maintained🟢 1030 commit(s) and 6 issue activity found in the last 90 days -- score normalized to 10
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
License⚠️ 0license file not detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
Security-Policy🟢 9security policy file detected
Fuzzing⚠️ 0project is not fuzzed
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9
npm/brace-expansion 5.0.9 🟢 7.2
Details
CheckScoreReason
Code-Review🟢 3Found 6/16 approved changesets -- score normalized to 3
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 1024 commit(s) and 15 issue activity found in the last 90 days -- score normalized to 10
Binary-Artifacts🟢 10no binaries found in the repo
Security-Policy🟢 10security policy file detected
Token-Permissions🟢 10GitHub workflow tokens follow principle of least privilege
Packaging⚠️ -1packaging workflow not detected
Pinned-Dependencies🟢 10all dependencies are pinned
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 9license file detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
Signed-Releases⚠️ -1no releases found
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
npm/sanitize-html 2.17.5 🟢 6.4
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Packaging⚠️ -1packaging workflow not detected
Maintained🟢 1030 commit(s) and 6 issue activity found in the last 90 days -- score normalized to 10
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 10no binaries found in the repo
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
License⚠️ 0license file not detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
Security-Policy🟢 9security policy file detected
Fuzzing⚠️ 0project is not fuzzed
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9
npm/postcss 8.5.23 🟢 7.4
Details
CheckScoreReason
Code-Review🟢 3Found 9/30 approved changesets -- score normalized to 3
Security-Policy🟢 10security policy file detected
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 1030 commit(s) and 15 issue activity found in the last 90 days -- score normalized to 10
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions🟢 9detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies🟢 10all dependencies are pinned
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Fuzzing🟢 10project is fuzzed
Branch-Protection🟢 3branch protection is not maximal on development and all release branches
Signed-Releases⚠️ -1no releases found
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
npm/postcss 8.5.23 🟢 7.4
Details
CheckScoreReason
Code-Review🟢 3Found 9/30 approved changesets -- score normalized to 3
Security-Policy🟢 10security policy file detected
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 1030 commit(s) and 15 issue activity found in the last 90 days -- score normalized to 10
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions🟢 9detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies🟢 10all dependencies are pinned
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Fuzzing🟢 10project is fuzzed
Branch-Protection🟢 3branch protection is not maximal on development and all release branches
Signed-Releases⚠️ -1no releases found
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
npm/sanitize-html ^2.17.5 UnknownUnknown
npm/postcss 8.5.23 🟢 7.4
Details
CheckScoreReason
Code-Review🟢 3Found 9/30 approved changesets -- score normalized to 3
Security-Policy🟢 10security policy file detected
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 1030 commit(s) and 15 issue activity found in the last 90 days -- score normalized to 10
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions🟢 9detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies🟢 10all dependencies are pinned
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
License🟢 10license file detected
Fuzzing🟢 10project is fuzzed
Branch-Protection🟢 3branch protection is not maximal on development and all release branches
Signed-Releases⚠️ -1no releases found
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • packages/api/package.json
  • pnpm-lock.yaml
  • sites/hacklytics2027/package.json
  • sites/mainweb/package.json
  • tooling/tailwind/package.json

@aamoghS
aamoghS marked this pull request as ready for review August 16, 2026 15:43
@github-actions

Copy link
Copy Markdown
Contributor

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);

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread packages/api/src/trpc.ts
if (!isHtmlSpace(prev) && prev !== "<") {
pos = on + 1;
continue;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2e77f1c. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown

Greptile Summary

The PR suppresses duplicate Cursor branch automation, replaces the vulnerable image-dimension dependency with a bounded parser, upgrades vulnerable dependencies, and hardens attacker-controlled logging and markup inspection.

  • Ignores cursor/** branches in the feature-to-development PR workflow.
  • Adds bounded PNG, JPEG, and WebP dimension parsing for profile-image uploads.
  • Replaces polynomial markup regexes with a linear scanner.
  • Updates sanitize-html, PostCSS, and brace-expansion resolutions.
  • Removes CR/LF and raw exception details from security-sensitive logs.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code-triggered failures identified.

The replacement image parser remains bounded and supports the upload contract, the markup-scanner differences do not reach a raw HTML sink in current callers, and the dependency and logging changes preserve current behavior while addressing the reported alerts.

Important Files Changed

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]
Loading

Reviews (1): Last reviewed commit: "Fix Dependabot and CodeQL alerts; stop d..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants