CVE-2018-25047
Smarty Cross-site Scripting vulnerability in pages that use smarty_function_mailto
In Smarty before 3.1.47 and 4.x before 4.2.1, libs/plugins/function.mailto.php allows XSS. A web page that uses smarty_function_mailto, and that could be parameterized using GET or POST input parameters, could allow injection of JavaScript code by a user.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- Low
- Availability
- None
Exploit likelihood
What each source reports
NVD Score used
5.4
In Smarty before 3.1.47 and 4.x before 4.2.1, libs/plugins/function.mailto.php allows XSS. A web page that uses smarty_function_mailto, and that could be parameterized using GET or POST input parameters, could allow injection of JavaScript code by a user.
- Record
CVE-2018-25047- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
CVE List No score
In Smarty before 3.1.47 and 4.x before 4.2.1, libs/plugins/function.mailto.php allows XSS. A web page that uses smarty_function_mailto, and that could be parameterized using GET or POST input parameters, could allow injection of JavaScript code by a user.
- Record
CVE-2018-25047- Updated
- 2026-11-02
EUVDEUVD-2022-6844 No score
In Smarty before 3.1.47 and 4.x before 4.2.1, libs/plugins/function.mailto.php allows XSS. A web page that uses smarty_function_mailto, and that could be parameterized using GET or POST input parameters, could allow injection of JavaScript code by a user.
- Record
EUVD-2022-6844- Updated
- 2026-11-02
GitHub AdvisoriesGHSA-hwq7-5vv9-c6cf
5.4
Smarty Cross-site Scripting vulnerability in pages that use smarty_function_mailto
In Smarty before 3.1.47 and 4.x before 4.2.1, libs/plugins/function.mailto.php allows cross-site scripting. A web page that uses smarty_function_mailto, and that could be parameterized using GET or POST input parameters, could allow injection of JavaScript code by a user.
- Record
GHSA-hwq7-5vv9-c6cf- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSV
5.4
In Smarty before 3.1.47 and 4.x before 4.2.1, libs/plugins/function.mailto.php allows XSS. A web page that uses smarty_function_mailto, and that could be parameterized using GET or POST input parameters, could allow injection of JavaScript code by a user.
- Record
CVE-2018-25047- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
OSVDEBIAN-CVE-2018-25047
5.4
In Smarty before 3.1.47 and 4.x before 4.2.1, libs/plugins/function.mailto.php allows XSS. A web page that uses smarty_function_mailto, and that could be parameterized using GET or POST input parameters, could allow injection of JavaScript code by a user.
- Record
DEBIAN-CVE-2018-25047- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
Show 4 moreShow less
OSVGHSA-hwq7-5vv9-c6cf
5.4
Smarty Cross-site Scripting vulnerability in pages that use smarty_function_mailto
In Smarty before 3.1.47 and 4.x before 4.2.1, libs/plugins/function.mailto.php allows cross-site scripting. A web page that uses smarty_function_mailto, and that could be parameterized using GET or POST input parameters, could allow injection of JavaScript code by a user.
- Record
GHSA-hwq7-5vv9-c6cf- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2018-25047
5.4
In Smarty before 3.1.47 and 4.x before 4.2.1, libs/plugins/function.mailto.php allows XSS. A web page that uses smarty_function_mailto, and that could be parameterized using GET or POST input parameters, could allow injection of JavaScript code by a user.
- Record
UBUNTU-CVE-2018-25047- CVSS 3.1
- 5.4 Medium
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
OSVMGASA-2023-0014 No score
Updated php-smarty packages fix security vulnerability
It was discovered that there was a potential cross-site scripting vulnerability in smarty3, a widely-used PHP templating engine.
In Smarty before 3.1.47 and 4.x before 4.2.1, libs/plugins/function.mailto.php allows XSS. A web page that uses smarty_function_mailto, and that could be parameterized using GET or POST input parameters, could allow injection of JavaScript code by a user. (CVE-2018-25047)
- Record
MGASA-2023-0014- Updated
- 2026-11-02
OSVUSN-7158-1 No score
smarty3 vulnerabilities
It was discovered that Smarty incorrectly handled query parameters in requests. An attacker could possibly use this issue to inject arbitrary Javascript code, resulting in denial of service or potential execution of arbitrary code. This issue only affected Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, Ubuntu 22.04 LTS and Ubuntu 24.04 LTS. (CVE-2018-25047, CVE-2023-28447)
It was discovered that Smarty did not properly sanitize user input when generating templates. An attacker could, through PHP injection, possibly use this issue to execute arbitrary code. (CVE-2024-35226)
- Record
USN-7158-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
smarty/smartyPackagist |
before 3.1.47 | 3.1.47 |
smarty/smartyPackagist |
4.0.0 up to 4.2.1 | 4.2.1 |
smarty3Debian:12 |
before 3.1.47-1 | 3.1.47-1 |
smarty3Debian:13 |
before 3.1.47-1 | 3.1.47-1 |
smarty3Debian:14 |
before 3.1.47-1 | 3.1.47-1 |
smarty4Debian:12 |
before 4.2.1-1 | 4.2.1-1 |
smarty4Debian:13 |
before 4.2.1-1 | 4.2.1-1 |
smarty4Debian:14 |
before 4.2.1-1 | 4.2.1-1 |
smarty3Debian:10 |
before 3.1.33+20180830.1.3a78a21f+selfpack1-1+deb10u2, plus listed versions 3.1.33+20180830.1.3a78a21f+selfpack1-13.1.33+20180830.1.3a78a21f+selfpack1-1+deb10u1 |
3.1.33+20180830.1.3a78a21f+selfpack1-1+deb10u2 |
smarty3Debian:11 From an advisory covering 3 CVEs |
before 3.1.39-2+deb11u2, plus listed versions 3.1.39-13.1.39-23.1.39-2+deb11u1 |
3.1.39-2+deb11u2 |
Show 15 moreShow less
| Package | Affected | Fixed |
|---|---|---|
smarty/smartyPackagist |
before 3.1.47, plus listed versions v2.6.24v2.6.25v2.6.26v2.6.27v2.6.28 Show 40 moreShow lessv2.6.29v2.6.30v2.6.31v2.6.33v3.1.11v3.1.12v3.1.13v3.1.14v3.1.15v3.1.16v3.1.17v3.1.18v3.1.19v3.1.20v3.1.21v3.1.23v3.1.24v3.1.25v3.1.26v3.1.27v3.1.28v3.1.29v3.1.30v3.1.31v3.1.32v3.1.33v3.1.34v3.1.35v3.1.36v3.1.37v3.1.37.1v3.1.38v3.1.39v3.1.40v3.1.41v3.1.42v3.1.43v3.1.44v3.1.45v3.1.46 |
3.1.47 |
smarty/smartyPackagist |
4.0.0 up to 4.2.1, plus listed versions v4.0.0v4.0.1v4.0.2v4.0.3v4.0.4v4.1.0v4.1.1v4.2.0 |
4.2.1 |
php-smartyMageia:8 |
before 4.2.1-1.mga8 | 4.2.1-1.mga8 |
smarty3Ubuntu:Pro:16.04:LTS |
All versions, plus listed versions 3.1.21-13.1.21-1ubuntu13.1.21-1ubuntu1+esm13.1.21-1ubuntu1+esm2 |
None known |
smarty3Ubuntu:Pro:18.04:LTS |
before 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1+esm1, plus listed versions 3.1.31+20161214.1.c7d42e4+selfpack1-23.1.31+20161214.1.c7d42e4+selfpack1-33.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1 |
3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1+esm1 |
smarty3Ubuntu:20.04:LTS |
before 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1, plus listed versions 3.1.33+20180830.1.3a78a21f+selfpack1-13.1.34+20190228.1.c9f0de05+selfpack1-1 |
3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1 |
smarty3Ubuntu:22.04:LTS |
before 3.1.39-2ubuntu1.22.04.2, plus listed versions 3.1.39-23.1.39-2ubuntu13.1.39-2ubuntu1.22.04.1 |
3.1.39-2ubuntu1.22.04.2 |
smarty3Ubuntu:24.04:LTS |
before 3.1.48-1ubuntu0.24.04.1, plus listed versions 3.1.48-1 |
3.1.48-1ubuntu0.24.04.1 |
smarty3Ubuntu:25.10 |
All versions, plus listed versions 3.1.48-2 |
None known |
smarty3Ubuntu:26.10 |
All versions, plus listed versions 3.1.48-2build1 |
None known |
smarty3Ubuntu:26.04:LTS |
All versions, plus listed versions 3.1.48-23.1.48-2build1 |
None known |
smarty3Ubuntu:Pro:18.04:LTS From an advisory covering 3 CVEs |
before 3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1+esm1, plus listed versions 3.1.31+20161214.1.c7d42e4+selfpack1-23.1.31+20161214.1.c7d42e4+selfpack1-33.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1 |
3.1.31+20161214.1.c7d42e4+selfpack1-3ubuntu0.1+esm1 |
smarty3Ubuntu:20.04:LTS From an advisory covering 3 CVEs |
before 3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1, plus listed versions 3.1.33+20180830.1.3a78a21f+selfpack1-13.1.34+20190228.1.c9f0de05+selfpack1-1 |
3.1.34+20190228.1.c9f0de05+selfpack1-1ubuntu0.1 |
smarty3Ubuntu:22.04:LTS From an advisory covering 3 CVEs |
before 3.1.39-2ubuntu1.22.04.2, plus listed versions 3.1.39-23.1.39-2ubuntu13.1.39-2ubuntu1.22.04.1 |
3.1.39-2ubuntu1.22.04.2 |
smarty3Ubuntu:24.04:LTS From an advisory covering 3 CVEs |
before 3.1.48-1ubuntu0.24.04.1, plus listed versions 3.1.48-1 |
3.1.48-1ubuntu0.24.04.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2018-25047 is a medium vulnerability (CVSS 5.4) in Smarty, published September 14, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.10%, the 65th percentile. Fixed in smarty/smarty 3.1.47.
References
github.com/smarty-php/smarty/issues/454
github.com/smarty-php/smarty/releases/tag/v4.2.1
github.com/smarty-php/smarty/releases/tag/v3.1.47
bugs.gentoo.org/870100
security.gentoo.org/glsa/202209-09
lists.debian.org/debian-lts-announce/2023/01/msg00002.html
Show 16 moreShow less
lists.debian.org/debian-lts-announce/2024/11/msg00013.html
nvd.nist.gov/vuln/detail/CVE-2018-25047
github.com/smarty-php/smarty/commit/55ea25d1f50f0406fb1ccedd212c527977793fc9
github.com/FriendsOfPHP/security-advisories/blob/master/smarty/smarty/CVE-2018-25047.yaml
github.com/advisories/GHSA-hwq7-5vv9-c6cf
security-tracker.debian.org/tracker/CVE-2018-25047
github.com/smarty-php/smarty
advisories.mageia.org/MGASA-2023-0014.html
bugs.mageia.org/show_bug.cgi?id=31387
debian.org/lts/security/2023/dla-3262
ubuntu.com/security/CVE-2018-25047
github.com/smarty-php/smarty/commit/f1f7ee6e34c14a8a9dfa5c6ef894d39277a93938
cve.org/CVERecord?id=CVE-2018-25047
ubuntu.com/security/notices/USN-7158-1
ubuntu.com/security/CVE-2023-28447
ubuntu.com/security/CVE-2024-35226