{"answers":{"affected":"2 open source packages ship an affected version, including netcarver/textile.","exploited":"There is no known exploitation of GHSA-95m2-chm4-mq7m in the wild and no public exploit code.","fix":"Upgrade netcarver/textile to 4.1.3 or later.","what":"GHSA-95m2-chm4-mq7m is a cross-site scripting vulnerability in netcarver/textile, published on 7 Jan 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for GHSA-95m2-chm4-mq7m and fix it if it is affected.\n\nWhat it is: GHSA-95m2-chm4-mq7m is a cross-site scripting vulnerability in netcarver/textile, published on 7 Jan 2025. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of GHSA-95m2-chm4-mq7m in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- netcarver/textile (Packagist): affected all versions; fixed in 4.1.3\n- netcarver/textile (Packagist): affected all versions; fixed in 4.1.3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-95m2-chm4-mq7m/ (Markdown: https://insights.sbomify.com/GHSA-95m2-chm4-mq7m/index.md)","id":"GHSA-95m2-chm4-mq7m","markdown":"https://insights.sbomify.com/GHSA-95m2-chm4-mq7m/index.md","name":"GHSA-95m2-chm4-mq7m","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","account_takeover"],"network_reachable":"yes","non_default_config":true,"product_category":"PHP Textile library","requires_auth":"low_privilege","summary":"Persistent XSS in PHP-Textile allows attackers to inject JavaScript via image links in restricted mode, requiring user interaction to execute.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### 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='\u003cscript\u003ealert(1);\u003c/script\u003e'+document.cookie)\n```\n\nWould render as the following HTML even in restricted mode:\n\n`\u003cp\u003e\u003ca href=\"javascript:document.innerHTML=\u0026#39;\u0026lt;script\u0026gt;alert(1);\u0026lt;/script\u0026gt;\u0026#39;+document.cookie\"\u003e\u003cimg alt=\"Click Tu\" src=\"securing.pl\" title=\"Click Tu\"\u003e\u003c/a\u003e)\u003c/p\u003e`\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.","ecosystems":["Packagist"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"PHP-Textile has persistent XSS vulnerability in image link handling","id":"GHSA-95m2-chm4-mq7m","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"xss","year":"2025"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"Packagist","fixed":["4.1.3"],"introduced":["0"],"last_affected":[],"package":"netcarver/textile","purl":null,"source":"GHSA-95m2-chm4-mq7m"},{"ecosystem":"Packagist","fixed":["4.1.3"],"introduced":["0"],"last_affected":[],"package":"netcarver/textile","purl":"pkg:composer/netcarver/textile","source":"GHSA-95m2-chm4-mq7m"}],"products":null,"published":"2025-01-07","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Persistent XSS in PHP-Textile allows attackers to inject JavaScript via image links in restricted mode, requiring user interaction to execute.","url":"https://insights.sbomify.com/GHSA-95m2-chm4-mq7m/"}