Vulnerabilities in pkg:maven/io.pebbletemplates/pebble

PACKAGE
Advisory Identifier: GHSA-p75g-cxfj-7wrx
Advisory Summary

CVE-2025-1686 is a HIGH (CVSS 6.8) pebble has arbitrary local file vulnerability (CWE-73: External Control of File Name or Path) affecting Pebble libraries in the Maven ecosystem. The issue involves pebble has arbitrary local file inclusion (lfi) vulnerability via `include` macro. Remediation is available in the latest vendor maintenance releases.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/io.pebbletemplates/pebble

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/io.pebbletemplates/pebble. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-p75g-cxfj-7wrx CVE-2025-1686 HIGH Pebble has Arbitrary Local File Inclusion (LFI) Vulnerability via `include` macro
GHSA-wxx5-w9jc-48wx CVE-2022-37767 CRITICAL Pebble Templates protection mechanism bypass can lead to arbitrary code execution

CVE-2025-1686 at a Glance

CVE Identifier CVE-2025-1686
GHSA Identifier GHSA-p75g-cxfj-7wrx
Severity HIGH
CVSS v3.1 Base Score 6.8
CWE Classification CWE-73: External Control of File Name or Path
Affected Product Pebble
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.8

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

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

How to Fix CVE-2025-1686

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

io.pebbletemplates:pebble fixed: Latest secure release
<dependency>
    <groupId>io.pebbletemplates</groupId>
    <artifactId>pebble</artifactId>
    <version>Latest secure release</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=io.pebbletemplates

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2025-1686, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=io.pebbletemplates

Analyze the terminal output to locate any version of Pebble 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: The mvn dependency:tree -Dincludes=io.pebbletemplates command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-73: External Control of File Name or Path, where the product allows user input to control or influence paths or file names that are used in filesystem operations. In Pebble, 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 If untrusted user input is used to dynamically create a `PebbleTemplate` with the method `PebbleEngine#getLiteralTemplate`, then an attacker can include arbitrary local files from the file system into the generated template, leaking potentially sensitive information into the output of `PebbleTemplate#evaluate`. This is done via the `include` macro. ### Details The `include` macro calls `PebbleTempateImpl#resolveRelativePath` with the `relativePath` argument passed within the template: Example template: ``` {% include [relativePath] %} ``` When `resolveRelativePath` is called, the `relativePath` is resolved against the `PebbleTemplateImpl.name` variable. ```java /** * This method resolves the given relative path based on this template file path. * * @param relativePath the path which should be resolved. * @return the resolved path. */ public String resolveRelativePath(String relativePath) { String resolved = this.engine.getLoader().resolveRelativePath(relativePath, this.name); if (resolved == null) { return relativePath; } else { return resolved; } } ``` https://github.com/PebbleTemplates/pebble/blob/82ad7fcf9e9eaa45ee82ae3335a1409d19c10263/pebble/src/main/java/io/pebbletemplates/pebble/template/PebbleTemplateImpl.java#L380 Unfortunately, when the template is created from a string, as is the case when `PebbleEngine#getLiteralTemplate` is used, the `PebbleTemplateImpl.name` variable is actually the entirety of the contents of the template, not a filename as the logic expects. The net result is that the `relativePath` is resolved against the system root directory. As a result, files accessible from the root directory of the filesystem can be included into a template. ### PoC The following test demonstrates the vulnerability: ```java PebbleEngine e = new PebbleEngine.Builder().build(); String templateString = """ {% include '/etc/passwd' %} """; PebbleTemplate template = e.getLiteralTemplate(templateString); try (final Writer writer = new StringWriter()) { template.evaluate(writer, new HashMap<>()); System.out.println(writer); } ``` As an attacker, the following malicious template demonstrates the vulnerability: ``` {% include '/etc/passwd' %} ``` ### Impact This is an arbitrary Local File Inclusion (LFI) vulnerability. It can allow attackers to exfiltrate the contents of the local filesystem, including sensitive files into `PebbleTemplate` output. This can also be used to access the `/proc` filesystem which can give an attacker access to environment variables. ### Fix There exists no published fix for this vulnerability. The best way to mitigate this vulnerability is to disable the `include` macro in Pebble Templates. The following can safeguard your application from this vulnerability: ```java new PebbleEngine.Builder() .registerExtensionCustomizer(new DisallowExtensionCustomizerBuilder() .disallowedTokenParserTags(List.of("include")) .build()) .build(); ``` ### Report Timeline Vulnerability was reported under the Open Source Security Foundation (OpenSSF) [Model Outbound Vulnerability Disclosure Policy: Version 0.1](https://openssf.org/about/vulnerability-disclosure-policy/). - [Jul 15, 2024](https://github.com/PebbleTemplates/pebble/issues/680#issue-2409727829) Maintainer Contacted to enable private vulnerability reporting - [Jul 18, 2024](https://github.com/PebbleTemplates/pebble/issues/680#issuecomment-2236970984) I opened a GHSA to report this vulnerability to the maintainer https://github.com/PebbleTemplates/pebble/security/advisories/GHSA-7c6h-hmf9-7wj7 (private link) - Jul 29, 2024 GHSA updated to ping maintainer about vulnerability, no response - Oct 1, 2024 GHSA updated to ping maintainer about vulnerability, no response - Nov 15, 2024 GHSA updated to inform maintainer that disclosure timeline had lapsed, no response. - Feb 19, 2025 GHSA updated to inform maintainer that disclosure would occur imminently, no response. - Feb 24, 2025 this GHSA was created to disclose this vulnerability **without a patch available**. For further discussion, see this issue: https://github.com/PebbleTemplates/pebble/issues/688 ### Credit This vulnerability was discovered by @JLLeitschuh while at [Chainguard Labs](https://www.chainguard.dev). Jonathan is currently independent.

CVE-2025-1686 Affected Pebble Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
io.pebbletemplates:pebble
Maven
≤ 3.2.3

References

Frequently Asked Questions

What is CVE-2025-1686?
CVE-2025-1686 is a security vulnerability in Pebble involving Pebble has Arbitrary Local File Inclusion (LFI) Vulnerability via `include` macro under CWE-73: External Control of File Name or Path.
Which Pebble versions are affected?
Affected versions include releases prior to current release patches across affected packages: io.pebbletemplates:pebble.
What version fixes CVE-2025-1686?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is pebble affected?
Yes, io.pebbletemplates:pebble is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2025-1686?
CVE-2025-1686 has a CVSS v3.1 base score of 6.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2025-1686?
CVE-2025-1686 is classified under CWE-73: External Control of File Name or Path (The product allows user input to control or influence paths or file names that are used in filesystem operations.).
How can I check Maven dependencies for CVE-2025-1686?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=io.pebbletemplates'. 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-p75g-cxfj-7wrx",
  "modified" : "2026-04-24T20:55:22Z",
  "published" : "2025-02-28T19:45:03Z",
  "aliases" : [ "CVE-2025-1686" ],
  "summary" : "Pebble has Arbitrary Local File Inclusion (LFI) Vulnerability via `include` macro",
  "details" : "### Summary\n\nIf untrusted user input is used to dynamically create a `PebbleTemplate` with the method `PebbleEngine#getLiteralTemplate`, then an attacker can include arbitrary local files from the file system into the generated template, leaking potentially sensitive information into the output of `PebbleTemplate#evaluate`. This is done via the `include` macro.\n\n### Details\n\nThe `include` macro calls `PebbleTempateImpl#resolveRelativePath` with the `relativePath` argument passed within the template:\n\nExample template:\n```\n{% include [relativePath] %}\n```\nWhen `resolveRelativePath` is called, the `relativePath`  is resolved against the `PebbleTemplateImpl.name` variable.\n\n```java\n  /**\n   * This method resolves the given relative path based on this template file path.\n   *\n   * @param relativePath the path which should be resolved.\n   * @return the resolved path.\n   */\n  public String resolveRelativePath(String relativePath) {\n    String resolved = this.engine.getLoader().resolveRelativePath(relativePath, this.name);\n    if (resolved == null) {\n      return relativePath;\n    } else {\n      return resolved;\n    }\n  }\n```\nhttps://github.com/PebbleTemplates/pebble/blob/82ad7fcf9e9eaa45ee82ae3335a1409d19c10263/pebble/src/main/java/io/pebbletemplates/pebble/template/PebbleTemplateImpl.java#L380\n\nUnfortunately, when the template is created from a string, as is the case when `PebbleEngine#getLiteralTemplate` is used, the `PebbleTemplateImpl.name` variable is actually the entirety of the contents of the template, not a filename as the logic expects. The net result is that the `relativePath` is resolved against the system root directory. As a result, files accessible from the root directory of the filesystem can be included into a template. \n\n### PoC\n\nThe following test demonstrates the vulnerability:\n\n```java\nPebbleEngine e = new PebbleEngine.Builder().build();\n\nString templateString = \"\"\"\n        {% include '/etc/passwd' %}\n        \"\"\";\nPebbleTemplate template = e.getLiteralTemplate(templateString);\n\ntry (final Writer writer = new StringWriter()) {\n    template.evaluate(writer, new HashMap<>());\n    System.out.println(writer);\n}\n```\n\nAs an attacker, the following malicious template demonstrates the vulnerability:\n\n```\n{% include '/etc/passwd' %}\n```\n\n### Impact\n\nThis is an arbitrary  Local File Inclusion (LFI) vulnerability. It can allow attackers to exfiltrate the contents of the local filesystem, including sensitive files into `PebbleTemplate` output. This can also be used to access the `/proc` filesystem which can give an attacker access to environment variables.\n\n### Fix\n\nThere exists no published fix for this vulnerability. The best way to mitigate this vulnerability is to disable the `include` macro in Pebble Templates.\n\nThe following can safeguard your application from this vulnerability:\n\n```java\nnew PebbleEngine.Builder()\n            .registerExtensionCustomizer(new DisallowExtensionCustomizerBuilder()\n                    .disallowedTokenParserTags(List.of(\"include\"))\n                    .build())\n            .build();\n```\n\n### Report Timeline\n\nVulnerability was reported under the Open Source Security Foundation (OpenSSF) [Model Outbound Vulnerability Disclosure Policy: Version 0.1](https://openssf.org/about/vulnerability-disclosure-policy/).\n\n - [Jul 15, 2024](https://github.com/PebbleTemplates/pebble/issues/680#issue-2409727829) Maintainer Contacted to enable private vulnerability reporting\n - [Jul 18, 2024](https://github.com/PebbleTemplates/pebble/issues/680#issuecomment-2236970984) I opened a GHSA \n to report this vulnerability to the maintainer https://github.com/PebbleTemplates/pebble/security/advisories/GHSA-7c6h-hmf9-7wj7 (private link)\n - Jul 29, 2024 GHSA updated to ping maintainer about vulnerability, no response\n - Oct 1, 2024 GHSA updated to ping maintainer about vulnerability, no response\n - Nov 15, 2024 GHSA updated to inform maintainer that disclosure timeline had lapsed, no response.\n - Feb 19, 2025 GHSA updated to inform maintainer that disclosure would occur imminently, no response.\n - Feb 24, 2025 this GHSA was created to disclose this vulnerability **without a patch available**.\n\nFor further discussion, see this issue: https://github.com/PebbleTemplates/pebble/issues/688\n\n### Credit\n\nThis vulnerability was discovered by @JLLeitschuh while at [Chainguard Labs](https://www.chainguard.dev). Jonathan is currently independent.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:H/VA:H/SC:L/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "io.pebbletemplates:pebble"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "3.2.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/JLLeitschuh/security-research/security/advisories/GHSA-p75g-cxfj-7wrx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-1686"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PebbleTemplates/pebble/issues/680"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PebbleTemplates/pebble/issues/688"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PebbleTemplates/pebble/pull/715"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/PebbleTemplates/pebble/commit/b3451c8f305a1a248fbcc2363fd307d0baaee329"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/PebbleTemplates/pebble"
  }, {
    "type" : "WEB",
    "url" : "https://pebbletemplates.io/wiki/tag/include"
  }, {
    "type" : "WEB",
    "url" : "https://security.snyk.io/vuln/SNYK-JAVA-IOPEBBLETEMPLATES-8745594"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-73" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-02-28T19:45:03Z",
    "nvd_published_at" : "2025-02-27T05:15:14Z"
  }
}