smarty Cross-site Scripting vulnerability in Javascript escapingGHSA-7j98-h7fp-4vwj
HIGHFix: smarty-php/smarty@6856624GHSA-7j98-h7fp-4vwj is a high-severity (CVSS 7.1) Cross-site Scripting (XSS) vulnerability in smarty/smarty. A fix is available for smarty/smarty — see the affected versions and patch details below.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
smarty/smarty🐘smarty/smartyReal-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
Impact
An attacker could exploit this vulnerability to execute arbitrary JavaScript code in the context of the user's browser session. This may lead to unauthorized access to sensitive user data, manipulation of the web application's behavior, or unauthorized actions performed on behalf of the user.
Patches
Please upgrade to the most recent version of Smarty v3 or v4.
For more information
If you have any questions or comments about this advisory please open an issue in the Smarty repo
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | smarty/smarty | ≥ 4.0.0&&< 4.3.1 | 4.3.1composer require smarty/smarty:^4.3.1 |
| 🐘Packagist | smarty/smarty | all versions | 3.1.48composer require smarty/smarty:^3.1.48 |
Affected Products
fedorafedoraprojectsmartysmartyDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for smarty/smarty, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update smarty/smarty to 4.3.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-7j98-h7fp-4vwj is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is GHSA-7j98-h7fp-4vwj in your dependencies?
Find it across Packagist, including transitive dependencies.