Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ GHSA-7cvr-xhm5-x998 — twig

⚪ Unknown ✅ No Known Exploit CWE-22 OSV
N/A
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Twig Path Traversal vulnerability in the filesystem loader

Twig is affected by path traversal vulnerability when used with Twig_Loader_Filesystem for loading Twig templates but only if the application is using non-trusted template names (names provided by a end-user for instance).

When affected, it is possible to go up one directory for the paths configured in the application's loader.

For instance, if the filesystem loader is configured with /path/to/templates as a path to look for templates, an attacker can force Twig to include a file stored in /path/to by prepending the path with /../ like in {% include "/../somefile_in_path_to" %}

Note that using anything else (like ../somefile, /../../somefile, or ../../somefile) won’t work and the application will return a proper exception.

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality low, integrity none, availability none.

Weakness class

GHSA-7cvr-xhm5-x998 is classified as CWE-22: Path Traversal. A file path built from user input is not confined to the intended directory, letting an attacker reach files elsewhere on the filesystem.

Affected software

GHSA-7cvr-xhm5-x998 is recorded against 1 package.

  • twig/twig (from 1.0.0 up to 1.12.3)

Timeline and source

Published on 30 May 2024 and last revised on 5 December 2024. No public exploit is currently recorded for this entry. Record sourced from OSV.

References

github.com (Web)
github.com (Web)
github.com (Package)
web.archive.org (Web)

Details

Severity Unknown
CVSS Score N/A
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
CWE CWE-22
Public Exploit ✅ No
Source OSV
Published 2024-05-30
Updated 2026-08-20
Modified 2024-12-05
Fix URL N/A

Affected Packages

Software From version Fixed in
twig/twig 1.0.0 1.12.3

Free Vulnerability Check

Is your site affected by GHSA-7cvr-xhm5-x998?

BotEraser helps you identify potentially vulnerable plugins and themes by checking your installation against GHSA-7cvr-xhm5-x998 and other known CVE records.

Scan My Site Free →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.