CVE-2023-25345
Directory Traversal vulnerability in swig-templates (npm)
What is CVE-2023-25345 About?
This vulnerability is a directory traversal flaw in `swig-templates` and `swig` through versions 2.0.4 and 1.4.2 respectively. It permits attackers to read arbitrary files by manipulating include or extends tags, making it relatively easy to exploit with crafted template paths.
Affected Software
- swig-templates
- <=2.0.4
- swig
- <=1.4.2
Technical Details
The directory traversal vulnerability exists in swig-templates (up to 2.0.4) and swig (up to 1.4.2). It specifically affects the handling of include or extends tags within the templating engine. An attacker can craft a template path string using directory traversal sequences (e.g., ../../) within these tags. When the template engine attempts to resolve and load the specified template or file, it misinterprets the path, allowing the attacker to access and read arbitrary files outside the intended template directory on the file system. This can expose sensitive information or configuration files.
What is the Impact of CVE-2023-25345?
Successful exploitation may allow attackers to read arbitrary files on the system, potentially leading to information disclosure of sensitive data.
What is the Exploitability of CVE-2023-25345?
Exploitation requires the ability to provide input to the templating engine that influences the path used by include or extends tags. The complexity is low to moderate, as it involves crafting a path with directory traversal sequences. No specific authentication or elevated privileges are strictly required, though access to an application endpoint that processes Swig templates is necessary. This can be a remote attack if the template input is user-contcontrolled and exposed via a web interface. The primary constraint is the ability to inject into the template paths. Risk factors include web applications that use vulnerable swig versions and dynamically render templates based on untrusted user input without proper path sanitization.
What are the Known Public Exploits?
| PoC Author | Link | Commentary |
|---|---|---|
| No known exploits | ||
What are the Available Fixes for CVE-2023-25345?
Available Upgrade Options
- No fixes available
Struggling with dependency upgrades?
See how Resolved Security's drop-in replacements make it simple.
Book a demoAdditional Resources
What are Similar Vulnerabilities to CVE-2023-25345?
Similar Vulnerabilities: CVE-2021-29491 , CVE-2020-15509 , CVE-2021-32693 , CVE-2022-24112 , CVE-2022-29007
