ApostropheCMS: Color field validation bypass allows stored XSS via HTML appended after rgb()/hsl() prefix
### Summary The color field accepts any string that *begins* with a valid `rgb()` / `hsl()` color, because `TinyColor.isValid` does not anchor its match at the end of the string. An authenticated user with edit rights can store arbitrary HTML after a valid color prefix. When the stored value is rendered , the payload executes, resulting in stored XSS. ### Details Server-side validation of the color field relies on TinyColor: ```js const { TinyColor } = require('@ctrl/tinycolor'); if (!new TinyColor(value).isValid) throw self.apos.error('invalid'); ``` TinyColor's `rgb`/`hsl` matchers are not anchored at the end of the string, while hex matchers are. Tested with @ctrl/tinycolor | Input | `isValid` | |---|---| | `rgb(1,2,3)` | `true` | | `rgb(1,2,3)` | `true` | | `hsl(0,100%,50%);--x:1}` | `true` | | `#ff0000` | `false` | The value is saved to MongoDB unchanged (not normalized to hex8). ### Relation to GHSA-97v6-998m-fp4g GHSA-97v6 addressed CSS custom property injection escaping a ``" OR "a separate HTML sink at X is exploitable"]. Fixing the validation (requiring the full string to be a color, or storing only TinyColor's normalized output) would close both. ### Impact Any user with edit permission can plant persistent JavaScript that runs in the browser of visitors and administrators viewing the affected page, enabling session hijacking and actions as an admin. ### Suggested fix Reject values unless the entire string is a valid color, e.g. normalize on save: ```js const c = n
- Products
- apostrophe
- Affected versions
- Not specified
- Fixed versions
- 4.34.0
- CVEs
- CVE-2026-112951
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 15:24 UTC · Revision 1
Source evidence
ApostropheCMS: Color field validation bypass allows stored XSS via HTML appended after rgb()/hsl() prefix
core-osv · Original sourcePublished 21 Oct 2026, 17:05 UTC
### Summary The color field accepts any string that *begins* with a valid `rgb()` / `hsl()` color, because `TinyColor.isValid` does not anchor its match at the end of the string. An authenticated user with edit rights can store arbitrary HTML after a valid color prefix. When the stored value is rendered , the payload executes, resulting in stored XSS. ### Details Server-side validation of the color field relies on TinyColor: ```js const { TinyColor } = require('@ctrl/tinycolor'); if (!new TinyColor(value).isValid) throw self.apos.error('invalid'); ``` TinyColor's `rgb`/`hsl` matchers are not anchored at the end of the string, while hex matchers are. Tested with @ctrl/tinycolor | Input | `isValid` | |---|---| | `rgb(1,2,3)` | `true` | | `rgb(1,2,3)` | `true` | | `hsl(0,100%,50%);--x:1}` | `true` | | `#ff0000` | `false` | The value is saved to MongoDB unchanged (not normalized to hex8). ### Relation to GHSA-97v6-998m-fp4g GHSA-97v6 addressed CSS custom property injection escaping a ``" OR "a separate HTML sink at X is exploitable"]. Fixing the validation (requiring the full string to be a color, or storing only TinyColor's normalized output) would close both. ### Impact Any user with edit permission can plant persistent JavaScript that runs in the browser of visitors and administrators viewing the affected page, enabling session hijacking and actions as an admin. ### Suggested fix Reject values unless the entire string is a valid color, e.g. normalize on save: ```js const c = n
osv:GHSA-vmgj-9cwm-cf3h
apostrophe
Fixed versions: 4.34.0
Complete source record
{
"id": "63e5e3a9e50591d1552dac097259d53ea957c3b107f862eaa5b9f523ca2cc510",
"url": "https://osv.dev/vulnerability/GHSA-vmgj-9cwm-cf3h",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "ApostropheCMS: Color field validation bypass allows stored XSS via HTML appended after rgb()/hsl() prefix",
"summary": "### Summary The color field accepts any string that *begins* with a valid `rgb()` / `hsl()` color, because `TinyColor.isValid` does not anchor its match at the end of the string. An authenticated user with edit rights can store arbitrary HTML after a valid color prefix. When the stored value is rendered , the payload executes, resulting in stored XSS. ### Details Server-side validation of the color field relies on TinyColor: ```js const { TinyColor } = require('@ctrl/tinycolor'); if (!new TinyColor(value).isValid) throw self.apos.error('invalid'); ``` TinyColor's `rgb`/`hsl` matchers are not anchored at the end of the string, while hex matchers are. Tested with @ctrl/tinycolor | Input | `isValid` | |---|---| | `rgb(1,2,3)` | `true` | | `rgb(1,2,3)` | `true` | | `hsl(0,100%,50%);--x:1}` | `true` | | `#ff0000` | `false` | The value is saved to MongoDB unchanged (not normalized to hex8). ### Relation to GHSA-97v6-998m-fp4g GHSA-97v6 addressed CSS custom property injection escaping a ``\" OR \"a separate HTML sink at X is exploitable\"]. Fixing the validation (requiring the full string to be a color, or storing only TinyColor's normalized output) would close both. ### Impact Any user with edit permission can plant persistent JavaScript that runs in the browser of visitors and administrators viewing the affected page, enabling session hijacking and actions as an admin. ### Suggested fix Reject values unless the entire string is a valid color, e.g. normalize on save: ```js const c = n",
"evidence": "osv:GHSA-vmgj-9cwm-cf3h",
"products": [
{
"name": {
"value": "apostrophe",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "4.34.0",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "medium",
"structured": {
"id": "GHSA-vmgj-9cwm-cf3h",
"aliases": [
"CVE-2026-112951",
"GHSA-vmgj-9cwm-cf3h"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N"
}
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
},
{
"fixed": "4.34.0"
}
]
}
],
"package": {
"name": "apostrophe",
"purl": "pkg:npm/apostrophe",
"ecosystem": "npm"
},
"database_specific": {
"source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-vmgj-9cwm-cf3h/GHSA-vmgj-9cwm-cf3h.json"
}
}
],
"modified": "2026-10-21T17:15:08.647725268Z",
"provider": "osv",
"references": [
"https://github.com/apostrophecms/apostrophe/security/advisories/GHSA-vmgj-9cwm-cf3h",
"https://nvd.nist.gov/vuln/detail/CVE-2026-112951",
"https://github.com/apostrophecms/apostrophe/commit/06e4b377f3c360f9e89c32dccd7e505ad5ddf498",
"https://github.com/apostrophecms/apostrophe/commit/40b989b1a9dd23d30029b8ce7668634265cfe5ea",
"https://github.com/apostrophecms/apostrophe",
"https://github.com/apostrophecms/apostrophe/releases/tag/apostrophe@4.34.0"
],
"provider_metadata": {
"cwe_ids": [
"CWE-79"
],
"severity": "MODERATE",
"github_reviewed": true,
"nvd_published_at": "2026-10-20T16:17:05Z",
"github_reviewed_at": "2026-10-21T17:05:44Z"
}
},
"related_cves": [
{
"value": "CVE-2026-112951",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 397041,
"published_at": "2026-10-21T17:05:44+00:00"
}