Summary
PHP-Textile has persistent XSS vulnerability in image link handling
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.
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.
Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.
GHSA-95M2-CHM4-MQ7M has a CVSS score of 7.3 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (4.1.3); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is GHSA-95M2-CHM4-MQ7M? GHSA-95M2-CHM4-MQ7M is a high-severity cross-site scripting (XSS) vulnerability in netcarver/textile (composer), affecting versions <= 4.1.2. It is fixed in 4.1.3. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
- How severe is GHSA-95M2-CHM4-MQ7M? GHSA-95M2-CHM4-MQ7M has a CVSS score of 7.3 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of netcarver/textile are affected by GHSA-95M2-CHM4-MQ7M? netcarver/textile (composer) versions <= 4.1.2 is affected.
- Is there a fix for GHSA-95M2-CHM4-MQ7M? Yes. GHSA-95M2-CHM4-MQ7M is fixed in 4.1.3. Upgrade to this version or later.
- Is GHSA-95M2-CHM4-MQ7M exploitable, and should I be worried? Whether GHSA-95M2-CHM4-MQ7M is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-95M2-CHM4-MQ7M is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-95M2-CHM4-MQ7M? Upgrade
netcarver/textileto 4.1.3 or later.