CVE-2024-58303: Fof/pretty mail FoF Pretty Mail Has A Vulnerability

HIGH
Advisory Identifier: GHSA-947q-2xw3-gx9c
CWE-1336
Published
Advisory Summary

CVE-2024-58303 is a HIGH fof pretty mail has a vulnerability (CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine) affecting Fof/pretty mail libraries in the Packagist ecosystem. The issue involves fof pretty mail has a server-side template injection vulnerability. Remediation is available in the latest vendor maintenance releases.

CVE-2024-58303 at a Glance

CVE Identifier CVE-2024-58303
GHSA Identifier GHSA-947q-2xw3-gx9c
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine
Affected Product Fof/pretty mail
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2024-58303

To remediate this vulnerability, upgrade all affected Fof/pretty mail dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

fof/pretty-mail fixed: Latest secure release
Upgrade fof/pretty-mail to Latest secure release
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 fof/pretty-mail

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-58303, inspect your project dependencies for Fof/pretty mail:

inspect dependencies for fof/pretty-mail

Analyze the terminal output to locate any version of Fof/pretty mail in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), 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-1336: Improper Neutralization of Special Elements Used in a Template Engine, where the product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine. In Fof/pretty mail, 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

FoF Pretty Mail 1.1.2 contains a server-side template injection vulnerability that allows administrative users to inject malicious code into email templates. Attackers can execute system commands by inserting crafted template expressions that trigger arbitrary code execution during email generation.

CVE-2024-58303 Affected Fof/pretty mail Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
fof/pretty-mail
Packagist
≤ 1.1.2

References

Frequently Asked Questions

What is CVE-2024-58303?
CVE-2024-58303 is a security vulnerability in Fof/pretty mail involving FoF Pretty Mail has a server-side template injection vulnerability under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine.
Which Fof/pretty mail versions are affected?
Affected versions include releases prior to current release patches across affected packages: fof/pretty-mail.
What version fixes CVE-2024-58303?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is fof/pretty-mail affected?
Yes, fof/pretty-mail is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with CVE-2024-58303?
CVE-2024-58303 is classified under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine (The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine.).
How can I check Packagist dependencies for CVE-2024-58303?
Run the dependency tree command: 'inspect dependencies for fof/pretty-mail'. 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-947q-2xw3-gx9c",
  "modified" : "2025-12-12T16:39:20Z",
  "published" : "2025-12-12T00:30:21Z",
  "aliases" : [ "CVE-2024-58303" ],
  "summary" : "FoF Pretty Mail has a server-side template injection vulnerability",
  "details" : "FoF Pretty Mail 1.1.2 contains a server-side template injection vulnerability that allows administrative users to inject malicious code into email templates. Attackers can execute system commands by inserting crafted template expressions that trigger arbitrary code execution during email generation.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "fof/pretty-mail"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-58303"
  }, {
    "type" : "WEB",
    "url" : "https://flarum.org"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/FriendsOfFlarum/pretty-mail"
  }, {
    "type" : "WEB",
    "url" : "https://www.exploit-db.com/exploits/51948"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/fof-pretty-mail-server-side-template-injection-via-email-template-settings"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1336" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-12T16:39:19Z",
    "nvd_published_at" : "2025-12-11T22:15:51Z"
  }
}