GHSA-95m2-chm4-mq7m: Netcarver/textile Cross-Site Scripting Vulnerability
HIGHGHSA-95m2-chm4-mq7m is a HIGH (CVSS 7.3) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Netcarver/textile libraries in the Packagist ecosystem. The issue involves php-textile has persistent xss vulnerability in image link handling. Remediation is available by upgrading affected packages to version 4.1.3.
GHSA-95m2-chm4-mq7m at a Glance
Security Impact
CVSS: 7.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L).
How to Fix GHSA-95m2-chm4-mq7m
To remediate this vulnerability, upgrade all affected Netcarver/textile dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade netcarver/textile to 4.1.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for netcarver/textile
How to Check if You Are Affected
To determine whether your application is affected by GHSA-95m2-chm4-mq7m, inspect your project dependencies for Netcarver/textile:
inspect dependencies for netcarver/textile
Analyze the terminal output to locate any version of Netcarver/textile in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.1.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Netcarver/textile, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-95m2-chm4-mq7m Affected Netcarver/textile Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
netcarver/textile
|
Packagist |
< 4.1.3
|
4.1.3
|
References
Frequently Asked Questions
What is GHSA-95m2-chm4-mq7m?
Which Netcarver/textile versions are affected?
What version fixes GHSA-95m2-chm4-mq7m?
Is netcarver/textile affected?
What is the CVSS score of GHSA-95m2-chm4-mq7m?
What CWE is associated with GHSA-95m2-chm4-mq7m?
How can I check Packagist dependencies for GHSA-95m2-chm4-mq7m?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-95m2-chm4-mq7m",
"modified" : "2025-01-07T17:11:02Z",
"published" : "2025-01-07T17:11:02Z",
"aliases" : [ ],
"summary" : "PHP-Textile has persistent XSS vulnerability in image link handling",
"details" : "### Details\n\nPersistent 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.\n\nIn 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.\n\nIn 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.\n\n### Resolution\n\nThis 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).\n\n### PoC\n\nThe following Textile input:\n\n```\n!securing.pl(Click Tu)!:javascript:document.innerHTML='<script>alert(1);</script>'+document.cookie)\n```\n\nWould render as the following HTML even in restricted mode:\n\n`<p><a href=\"javascript:document.innerHTML='<script>alert(1);</script>'+document.cookie\"><img alt=\"Click Tu\" src=\"securing.pl\" title=\"Click Tu\"></a>)</p>`\n\n### Impact\n\nThe attacker can perform any operation in the application with user’s privileges or remotely control user’s browser with automated tools.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "netcarver/textile"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.1.3"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 4.1.2"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/textile/php-textile/security/advisories/GHSA-95m2-chm4-mq7m"
}, {
"type" : "WEB",
"url" : "https://github.com/textile/php-textile/commit/ab18ae9703bee8b15f1b9d889d40e1881728bae6"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/textile/php-textile"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-01-07T17:11:02Z",
"nvd_published_at" : null
}
}