CVE-2025-62416: Bagisto/bagisto Bagisto Has Server Side Template Vulnerability

MODERATE
Advisory Identifier: GHSA-527q-4wqv-g9wj
CVSS 5.1
CWE-94 CWE-1336
Published
Advisory Summary

CVE-2025-62416 is a MODERATE (CVSS 5.1) bagisto has server side template vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Bagisto/bagisto libraries in the Packagist ecosystem. The issue involves bagisto has server side template injection (ssti) in product description. Remediation is available by upgrading affected packages to version 2.3.8.

CVE-2025-62416 at a Glance

CVE Identifier CVE-2025-62416
GHSA Identifier GHSA-527q-4wqv-g9wj
Severity MODERATE
CVSS v3.1 Base Score 5.1
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Bagisto/bagisto
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2025-62416

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

bagisto/bagisto fixed: 2.3.8
Upgrade bagisto/bagisto to 2.3.8
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 bagisto/bagisto

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-62416, inspect your project dependencies for Bagisto/bagisto:

inspect dependencies for bagisto/bagisto

Analyze the terminal output to locate any version of Bagisto/bagisto in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.8), 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Bagisto/bagisto, 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

### Summary Bagisto v2.3.7 is vulnerable to Server-Side Template Injection (SSTI) due to unsanitized user input being processed by the server-side templating engine when rendering product descriptions. This allows an attacker with product creation privileges to inject arbitrary template expressions that are evaluated by the backend — potentially leading to Remote Code Execution (RCE) on the server. ### Details In Bagisto, product descriptions are rendered through Laravel’s Blade templating engine in various front-end and admin views. The product description field is not sanitized or escaped before being passed to the view, which means user-supplied data can break out of the expected string context and execute arbitrary template code. ### PoC Create a product and enter the payload to the description. <img width="679" height="669" alt="image" src="https://github.com/user-attachments/assets/1e5dac3f-4043-4b31-98ed-f4346feb5477" /> Preview the page, observed that the template expressions were evaluated by the backend and displayed on the screen. <img width="1431" height="922" alt="image" src="https://github.com/user-attachments/assets/16f29c6e-05f4-40c4-9926-0c59e0a979c2" /> ### Impact RCE potential: Attackers can execute arbitrary PHP code or system commands. Data breach: Read sensitive environment variables (.env), API keys, or database credentials. Defacement / persistence: Inject malicious scripts or backdoors in dynamic templates. Privilege escalation: If attackers have limited roles (e.g., product manager), they can compromise the entire application or host.

CVE-2025-62416 Affected Bagisto/bagisto Versions

1 component(s)
Fixed Versions:
2.3.8
Product / Package Ecosystem Affected Versions Fixed Version
bagisto/bagisto
Packagist
< 2.3.8
2.3.8

References

Frequently Asked Questions

What is CVE-2025-62416?
CVE-2025-62416 is a security vulnerability in Bagisto/bagisto involving bagisto has Server Side Template Injection (SSTI) in Product Description under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Bagisto/bagisto versions are affected?
Affected versions include releases prior to 2.3.8 across affected packages: bagisto/bagisto.
What version fixes CVE-2025-62416?
Upgrading to 2.3.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bagisto/bagisto affected?
Yes, bagisto/bagisto is affected in releases prior to 2.3.8. Upgrade your dependency to 2.3.8 or later.
What is the CVSS score of CVE-2025-62416?
CVE-2025-62416 has a CVSS v3.1 base score of 5.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:L.
What CWE is associated with CVE-2025-62416?
CVE-2025-62416 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check Packagist dependencies for CVE-2025-62416?
Run the dependency tree command: 'inspect dependencies for bagisto/bagisto'. 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-527q-4wqv-g9wj",
  "modified" : "2025-10-16T21:54:30Z",
  "published" : "2025-10-16T20:28:35Z",
  "aliases" : [ "CVE-2025-62416" ],
  "summary" : "bagisto has Server Side Template Injection (SSTI) in Product Description",
  "details" : "### Summary\nBagisto v2.3.7 is vulnerable to Server-Side Template Injection (SSTI) due to unsanitized user input being processed by the server-side templating engine when rendering product descriptions. This allows an attacker with product creation privileges to inject arbitrary template expressions that are evaluated by the backend — potentially leading to Remote Code Execution (RCE) on the server.\n\n### Details\nIn Bagisto, product descriptions are rendered through Laravel’s Blade templating engine in various front-end and admin views. The product description field is not sanitized or escaped before being passed to the view, which means user-supplied data can break out of the expected string context and execute arbitrary template code.\n\n### PoC\nCreate a product and enter the payload to the description.\n<img width=\"679\" height=\"669\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1e5dac3f-4043-4b31-98ed-f4346feb5477\" />\nPreview the page, observed that the template expressions were evaluated by the backend and displayed on the screen.\n<img width=\"1431\" height=\"922\" alt=\"image\" src=\"https://github.com/user-attachments/assets/16f29c6e-05f4-40c4-9926-0c59e0a979c2\" />\n\n\n### Impact\nRCE potential: Attackers can execute arbitrary PHP code or system commands.\nData breach: Read sensitive environment variables (.env), API keys, or database credentials.\nDefacement / persistence: Inject malicious scripts or backdoors in dynamic templates.\nPrivilege escalation: If attackers have limited roles (e.g., product manager), they can compromise the entire application or host.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:C/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "bagisto/bagisto"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.8"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.3.7"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/bagisto/bagisto/security/advisories/GHSA-527q-4wqv-g9wj"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-62416"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bagisto/bagisto"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1336", "CWE-94" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-10-16T20:28:35Z",
    "nvd_published_at" : "2025-10-16T19:15:34Z"
  }
}