Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐘
🐘 Packagist
Not in CISA KEV
HIGH severity

GHSA-95m2-chm4-mq7m netcarver/textile

HIGHFix: textile/php-textile@ab18ae9

GHSA-95m2-chm4-mq7m is a high-severity (CVSS 7.3) vulnerability in netcarver/textile. A fix is available for netcarver/textile — see the affected versions and patch details below.

PHP-Textile has persistent XSS vulnerability in image link handling

Published
Jan 7, 2025
Updated
Jan 7, 2025
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Jan 7, 2025 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

1 pkg affected
🐘netcarver/textile

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.

Description

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=&#39;&lt;script&gt;alert(1);&lt;/script&gt;&#39;+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.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐘Packagistnetcarver/textileall versions4.1.3composer require netcarver/textile:^4.1.3

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for netcarver/textile, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update netcarver/textile to 4.1.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-95m2-chm4-mq7m is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-95m2-chm4-mq7m can be triaged on real exposure rather than presence alone.

Tailored to GHSA-95m2-chm4-mq7m. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### 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 whic
O3 Security · Impact-Aware SCA

Is GHSA-95m2-chm4-mq7m in your dependencies?

O3 Security finds GHSA-95m2-chm4-mq7m across Packagist dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-95m2-chm4-mq7m: XSS (High 7.3) | O3 Security