PHP-Textile has persistent XSS vulnerability in image link handling
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-79.
Summary
### Details Persistent XSS vulnerability in image link handling of PHP-Textile versions 4.1.2 and older, when running the parser in restricted mode. In restricted mode it is expected that the input would be sanitized, allowing user-input (such as user comments) to be parsed and handled safely by the PHP-Textile library. In restricted mode, the version 4.1.2 of the library does not sanitize or validate user-controllable href input in image links, but allows any link protocol or JavaScriptt links to be used. The vulnerability allows an attacker to add malicious JavaScript code to the page which is then executed when an unexpecting user clicks the link. In non-restricted mode, the library allows mixed HTML input, and any link protocol by design. In restricted mode, text links were already handled correctly and the vulnerability only affects image links. ### Resolution This issue was fixed in PHP-Textile version 4.1.3. Version 4.1.3 disallows use of JavaScript in image links when the parser is ran in restricted mode. Restricted mode can be enabled with `Parser::setRestricted()` method prior to calling the `parse` method. For more information, see **Parsing unstructed input** in the project's [README](https://github.com/textile/php-textile?tab=readme-ov-file#parsing-untrusted-input). ### PoC The following Textile input: ``` !securing.pl(Click Tu)!:javascript:document.innerHTML='<script>alert(1);</script>'+document.cookie) ``` Would render as the following HTML even in restricted mode: `<p><a href="javascript:document.innerHTML='<script>alert(1);</script>'+document.cookie"><img alt="Click Tu" src="securing.pl" title="Click Tu"></a>)</p>` ### Impact The attacker can perform any operation in the application with user’s privileges or remotely control user’s browser with automated tools.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | netcarver/textile (Packagist) | before 4.1.3 | 4.1.3 | Patch available | GHSA-95m2-chm4-mq7m |
- netcarver/textile (Packagist) Vendor— Affected before 4.1.3 Fixed in 4.1.3 Patch available GHSA-95m2-chm4-mq7m
Remediation
- Fix · GHSA-95m2-chm4-mq7m netcarver/textile (Packagist) Fixed in 4.1.3 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-95m2-chm4-mq7m
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences