GHSA-95m2-chm4-mq7m: Netcarver/textile Cross-Site Scripting Vulnerability

HIGH
CVSS 7.3
CWE-79
Published
Advisory Summary

GHSA-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

CVE Identifier N/A
GHSA Identifier GHSA-95m2-chm4-mq7m
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Netcarver/textile
Package Ecosystem Packagist
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (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.

netcarver/textile fixed: 4.1.3
Upgrade netcarver/textile to 4.1.3
Verify Direct and Transitive Dependencies

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

### 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=&#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.

GHSA-95m2-chm4-mq7m Affected Netcarver/textile Versions

1 component(s)
Fixed Versions:
4.1.3
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?
GHSA-95m2-chm4-mq7m is a security vulnerability in Netcarver/textile involving PHP-Textile has persistent XSS vulnerability in image link handling under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Netcarver/textile versions are affected?
Affected versions include releases prior to 4.1.3 across affected packages: netcarver/textile.
What version fixes GHSA-95m2-chm4-mq7m?
Upgrading to 4.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is netcarver/textile affected?
Yes, netcarver/textile is affected in releases prior to 4.1.3. Upgrade your dependency to 4.1.3 or later.
What is the CVSS score of GHSA-95m2-chm4-mq7m?
GHSA-95m2-chm4-mq7m has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with GHSA-95m2-chm4-mq7m?
GHSA-95m2-chm4-mq7m is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check Packagist dependencies for GHSA-95m2-chm4-mq7m?
Run the dependency tree command: 'inspect dependencies for netcarver/textile'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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=&#39;&lt;script&gt;alert(1);&lt;/script&gt;&#39;+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
  }
}