Skip to content

Commit 1b6b35d

Browse files
1 parent 23fe57f commit 1b6b35d

File tree

3 files changed

+229
-0
lines changed

3 files changed

+229
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-fvwq-45qv-xvhv",
4+
"modified": "2026-03-11T00:26:13Z",
5+
"published": "2026-03-11T00:26:13Z",
6+
"aliases": [
7+
"CVE-2026-31859"
8+
],
9+
"summary": "CraftCMS vulnerable to reflective XSS via incomplete return URL sanitization",
10+
"details": "### Summary\n\nThe fix for CVE-2025-35939 in `craftcms/cms` introduced a `strip_tags()` call in `src/web/User.php` to sanitize return URLs before they are stored in the session. However, `strip_tags()` only removes HTML tags (angle brackets) -- it does not inspect or filter URL schemes. Payloads like `javascript:alert(document.cookie)` contain no HTML tags and pass through `strip_tags()` completely unmodified, enabling reflected XSS when the return URL is rendered in an `href` attribute.\n\n### Details\nThe patched code in is:\n\n```php\npublic function setReturnUrl($url): void\n{\n parent::setReturnUrl(strip_tags($url));\n}\n```\n\n`strip_tags()` removes HTML tags (e.g., `<script>`, `<img>`) from a string, but it is **not** a URL sanitizer. When the sanitized return URL is subsequently rendered in an `href` attribute context (e.g., `<a href=\"{{ returnUrl }}\">`), the following dangerous payloads survive `strip_tags()` completely unmodified:\n\n1. **`javascript:` protocol URLs** -- `javascript:alert(document.cookie)` contains no HTML tags, so `strip_tags()` returns it verbatim. When placed in an `href`, clicking the link executes the JavaScript.\n\n2. **`data:` URIs** -- `data:text/html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg==` uses Base64 encoding and contains no tags at all, bypassing `strip_tags()` entirely.\n\n3. **Protocol-relative URLs** -- `//evil.com/steal` contains no tags and is passed through unchanged. When rendered as an `href`, the browser resolves it relative to the current page’s protocol, redirecting the user to an attacker-controlled domain.\n\nThe core issue is that `strip_tags()` operates on HTML syntax (angle brackets) while the threat model here requires URL scheme validation. These are fundamentally different security concerns.\n\n### Impact\n\n**Reflected XSS via crafted return URL.** An attacker constructs a malicious link such as `https://target.example.com/craft/?returnUrl=javascript:alert(document.cookie)` and sends it to a victim. The attack flow is:\n\n1. Victim clicks the link, visiting the Craft CMS site.\n2. The application calls `setReturnUrl()` with the attacker-controlled value.\n3. `strip_tags()` processes the URL but finds no HTML tags -- it passes through unchanged.\n4. The URL is stored in the session and later rendered in an `href` attribute (e.g., a \"Return\" or \"Continue\" link).\n5. When the victim clicks that link, `javascript:alert(document.cookie)` executes in the context of the Craft CMS origin.\n\nThis enables:\n- **Session hijacking** via cookie theft (`document.cookie`)\n- **Data exfiltration** via `fetch()` to an attacker-controlled server\n- **Phishing** by redirecting to a lookalike domain (protocol-relative URL)\n- **CSRF** by performing actions on behalf of the authenticated user",
11+
"severity": [],
12+
"affected": [
13+
{
14+
"package": {
15+
"ecosystem": "Packagist",
16+
"name": "craftcms/cms"
17+
},
18+
"ranges": [
19+
{
20+
"type": "ECOSYSTEM",
21+
"events": [
22+
{
23+
"introduced": "4.15.3"
24+
},
25+
{
26+
"fixed": "4.17.3"
27+
}
28+
]
29+
}
30+
],
31+
"database_specific": {
32+
"last_known_affected_version_range": "<= 4.17.2"
33+
}
34+
},
35+
{
36+
"package": {
37+
"ecosystem": "Packagist",
38+
"name": "craftcms/cms"
39+
},
40+
"ranges": [
41+
{
42+
"type": "ECOSYSTEM",
43+
"events": [
44+
{
45+
"introduced": "5.7.5"
46+
},
47+
{
48+
"fixed": "5.9.7"
49+
}
50+
]
51+
}
52+
],
53+
"database_specific": {
54+
"last_known_affected_version_range": "<= 5.9.6"
55+
}
56+
}
57+
],
58+
"references": [
59+
{
60+
"type": "WEB",
61+
"url": "https://github.com/craftcms/cms/security/advisories/GHSA-fvwq-45qv-xvhv"
62+
},
63+
{
64+
"type": "WEB",
65+
"url": "https://github.com/craftcms/cms/commit/cc9921c14897ee2b592a431c2356af8a04ce4cfe"
66+
},
67+
{
68+
"type": "PACKAGE",
69+
"url": "https://github.com/craftcms/cms"
70+
}
71+
],
72+
"database_specific": {
73+
"cwe_ids": [
74+
"CWE-116",
75+
"CWE-79"
76+
],
77+
"severity": "LOW",
78+
"github_reviewed": true,
79+
"github_reviewed_at": "2026-03-11T00:26:13Z",
80+
"nvd_published_at": null
81+
}
82+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-g7j6-fmwx-7vp8",
4+
"modified": "2026-03-11T00:27:23Z",
5+
"published": "2026-03-11T00:27:23Z",
6+
"aliases": [
7+
"CVE-2026-31858"
8+
],
9+
"summary": "CraftCMS's `ElementSearchController` Affected by Blind SQL Injection",
10+
"details": "The `ElementSearchController::actionSearch()` endpoint is missing the `unset()` protection that\nwas added to ElementIndexesController in [GHSA-2453-mppf-46cj](https://github.com/craftcms/cms/security/advisories/GHSA-2453-mppf-46cj).\n\nThe exact same SQL injection vulnerability (including `criteria[orderBy]`, the original advisory vector) works on this controller because the fix was never applied to it.\n\nAny authenticated control panel user (no admin required) can inject arbitrary SQL via `criteria[where]`,\n`criteria[orderBy]`, or other query properties, and extract the full database contents via boolean-based blind injection.\n\nUsers should update to the patched 5.9.9 release to mitigate the issue.",
11+
"severity": [],
12+
"affected": [
13+
{
14+
"package": {
15+
"ecosystem": "Packagist",
16+
"name": "craftcms/cms"
17+
},
18+
"ranges": [
19+
{
20+
"type": "ECOSYSTEM",
21+
"events": [
22+
{
23+
"introduced": "5.0.0-RC1"
24+
},
25+
{
26+
"fixed": "5.9.9"
27+
}
28+
]
29+
}
30+
],
31+
"database_specific": {
32+
"last_known_affected_version_range": "<= 5.9.8"
33+
}
34+
}
35+
],
36+
"references": [
37+
{
38+
"type": "WEB",
39+
"url": "https://github.com/craftcms/cms/security/advisories/GHSA-2453-mppf-46cj"
40+
},
41+
{
42+
"type": "WEB",
43+
"url": "https://github.com/craftcms/cms/security/advisories/GHSA-g7j6-fmwx-7vp8"
44+
},
45+
{
46+
"type": "WEB",
47+
"url": "https://github.com/craftcms/cms/commit/e1a3dd669ae31491b86ad996e88a1d30d33d9a42"
48+
},
49+
{
50+
"type": "PACKAGE",
51+
"url": "https://github.com/craftcms/cms"
52+
}
53+
],
54+
"database_specific": {
55+
"cwe_ids": [
56+
"CWE-89"
57+
],
58+
"severity": "HIGH",
59+
"github_reviewed": true,
60+
"github_reviewed_at": "2026-03-11T00:27:23Z",
61+
"nvd_published_at": null
62+
}
63+
}
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-q3vj-96h2-gwvg",
4+
"modified": "2026-03-11T00:26:37Z",
5+
"published": "2026-03-11T00:26:37Z",
6+
"aliases": [
7+
"CVE-2026-31856"
8+
],
9+
"summary": "Parse Server vulnerable to SQL injection via `Increment` operation on nested object field in PostgreSQL",
10+
"details": "### Impact\n\nA SQL injection vulnerability exists in the PostgreSQL storage adapter when processing `Increment` operations on nested object fields using dot notation (e.g., `stats.counter`). The `amount` value is interpolated directly into the SQL query without parameterization or type validation. An attacker who can send write requests to the Parse Server REST API can inject arbitrary SQL subqueries to read any data from the database, bypassing CLPs and ACLs.\n\nMongoDB deployments are not affected.\n\n### Patches\n\nThe fix adds type validation to reject non-number values and parameterizes the value in the SQL query instead of interpolating it.\n\n### Workarounds\n\nThere is no known workaround.\n\n### References\n\n- GitHub security advisory: https://github.com/parse-community/parse-server/security/advisories/GHSA-q3vj-96h2-gwvg\n- Fix Parse Server 9: https://github.com/parse-community/parse-server/releases/tag/9.6.0-alpha.3\n- Fix Parse Server 8: https://github.com/parse-community/parse-server/releases/tag/8.6.29",
11+
"severity": [
12+
{
13+
"type": "CVSS_V4",
14+
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "npm",
21+
"name": "parse-server"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "9.0.0-alpha.1"
29+
},
30+
{
31+
"fixed": "9.6.0-alpha.3"
32+
}
33+
]
34+
}
35+
]
36+
},
37+
{
38+
"package": {
39+
"ecosystem": "npm",
40+
"name": "parse-server"
41+
},
42+
"ranges": [
43+
{
44+
"type": "ECOSYSTEM",
45+
"events": [
46+
{
47+
"introduced": "0"
48+
},
49+
{
50+
"fixed": "8.6.29"
51+
}
52+
]
53+
}
54+
]
55+
}
56+
],
57+
"references": [
58+
{
59+
"type": "WEB",
60+
"url": "https://github.com/parse-community/parse-server/security/advisories/GHSA-q3vj-96h2-gwvg"
61+
},
62+
{
63+
"type": "PACKAGE",
64+
"url": "https://github.com/parse-community/parse-server"
65+
},
66+
{
67+
"type": "WEB",
68+
"url": "https://github.com/parse-community/parse-server/releases/tag/8.6.29"
69+
},
70+
{
71+
"type": "WEB",
72+
"url": "https://github.com/parse-community/parse-server/releases/tag/9.6.0-alpha.3"
73+
}
74+
],
75+
"database_specific": {
76+
"cwe_ids": [
77+
"CWE-89"
78+
],
79+
"severity": "CRITICAL",
80+
"github_reviewed": true,
81+
"github_reviewed_at": "2026-03-11T00:26:37Z",
82+
"nvd_published_at": null
83+
}
84+
}

0 commit comments

Comments
 (0)