/

CVE-2026-63135

Severity:

HIGH RISK

(8.2)

Stored XSS (CWE-79) in YOURLS Statistics Dashboard

CVE-2026-63135

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Account and Same-Origin Application Compromise

Severity:

HIGH RISK

(8.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

YOURLS contains a stored cross-site scripting vulnerability in its statistics charts, where attacker-controlled HTTP Referer data is inserted into inline JavaScript without appropriate escaping. An unauthenticated attacker may poison statistics for an existing short URL, causing JavaScript to execute when an administrator or other viewer opens the affected statistics page.

Affected context

The vulnerability occurs in YOURLS deployments that collect redirect referrer data and display derived domains in statistics charts. Risk is present when a crafted referrer is accepted, stored, and later incorporated into a statistics page's inline JavaScript without JavaScript-string encoding. Administrators and users with access to public or authenticated statistics pages may be affected when viewing poisoned data.

Exploit preconditions

  • Attack surface: HTTP redirect handling and statistics-page rendering
  • Required access: No YOURLS account is generally required; the attacker needs a way to cause a short URL to receive a crafted referrer
  • Trigger point: An administrator or statistics viewer opens the affected chart page
  • Why exploitation is possible: Stored referrer-derived values are inserted into inline JavaScript without context-appropriate escaping

Why this happens

The underlying bug is a failure to treat HTTP Referer data as untrusted content throughout its storage and presentation lifecycle. Although the value is processed as a URL or domain, the chart-generation logic concatenates it into JavaScript source without applying JavaScript-string escaping or using a safe data-transfer mechanism. This behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation, specifically stored cross-site scripting caused by unsafe output encoding in a script context.

Potential impact

  • Attacker-controlled JavaScript may execute in the YOURLS origin
  • Administrator-visible information may be exposed
  • API signature tokens or other sensitive same-origin data could be accessed
  • Privileged same-origin actions could be performed through a victim's session
  • Statistics and related application data may be modified or poisoned

General mitigation guidance

Mitigation generally focuses on preserving untrusted-data boundaries and preventing dynamic values from becoming executable script.

Common defensive patterns include:

  • Apply context-appropriate JavaScript-string encoding to every untrusted value rendered into script
  • Prefer JSON serialization into non-executable data elements or server-rendered text over string concatenation
  • Validate and normalize referrer-derived domains using an allowlisted schema before storage and display
  • Avoid inline JavaScript where secure event handling and external scripts are practical
  • Use restrictive Content Security Policy controls as defense in depth
  • Limit API-token exposure and run administrative sessions with least privilege
  • Treat stored analytics and logging fields as untrusted even when they appear to contain URLs or domains

How teams detect issues like this

High-level detection can include:

  • Static analysis searches for concatenation of request headers or stored database values into JavaScript, HTML attributes, or script blocks
  • Code review checks for missing output encoding at each rendering context
  • Tests that place benign marker strings containing script-context metacharacters in referrer and analytics fields, then verify they remain inert
  • Dynamic application testing of redirect logging and statistics pages under both authenticated and unauthenticated viewing paths
  • Content Security Policy reporting to identify unexpected inline script execution or violations
  • Policy enforcement requiring templating encoders, safe JSON serializers, and review of inline-script changes
  • Automated security review tools may help identify common reflected and stored XSS patterns, but should be supplemented with context-aware testing

Sources

SourceLink
github.comgithub.com/YOURLS/YOURLS/commit/e1e93476655107e6caab34e52259eb1c91079ec7
github.comgithub.com/YOURLS/YOURLS/pull/4107
github.comgithub.com/YOURLS/YOURLS/releases/tag/1.10.4
github.comgithub.com/YOURLS/YOURLS/security/advisories/GHSA-5h77-88j3-r659

Frequently asked

questions

Yes, in typical deployments an attacker can submit or cause a crafted referrer to be recorded through normal short-URL redirection. Code execution in a victim's browser generally occurs later when a statistics page containing the poisoned value is opened.

The described poisoning step does not generally require authentication. The attacker does need a usable short URL and a way to cause traffic with the crafted referrer; the impact depends on which victim views the resulting statistics page.

Keep referrer data non-executable by using context-aware output encoding and safe JSON or DOM data handling instead of concatenating untrusted values into inline JavaScript.

Treat request headers, analytics fields, and stored URL metadata as untrusted input, enforce output-encoding rules through code review and automated checks, minimize inline scripts, and use restrictive browser security policies as defense in depth.

Find out what's already
exploitable in your codebase.