CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-107716

CVE-2026-107716: Path Traversal and Link Following in banks DirectoryPromptRegistry

Amit Schendel
Amit Schendel
Senior Security Researcher

Oct 9, 2026·7 min read·8 visits

Executive Summary (TL;DR)

Vulnerability in banks < 2.5.1 allows arbitrary file read and write operations via symbolic links placed inside the prompt registry directory.

Improper pathname limitation and link resolution (CWE-22 and CWE-59) in the banks library prior to version 2.5.1 allow local attackers to read or write arbitrary files via crafted symbolic links in the prompt directory registry.

Vulnerability Overview

The library banks provides prompt management and templating capability, serving as a layer on top of the Jinja rendering engine. Within this library, the class banks.registries.DirectoryPromptRegistry manages on-disk storage, parsing, and indexing of prompt template files. Applications utilizing this registry component face exposure if they process template directories modified by untrusted entities.

This vulnerability, classified under CVE-2026-107716, belongs to the Improper Limitation of a Pathname (CWE-22) and Link Following (CWE-59) bug classes. Prior to the patch in version 2.5.1, the component failed to validate filesystem node characteristics before resolving paths and executing read or write operations. Consequently, symbolic links placed inside the registry root are traversed, leading to unauthorized access outside the intended directory boundary.

The attack surface becomes active in architectures where users can upload template packages or control the files loaded by the application. Because the engine resolves these inputs automatically, an attacker can read sensitive system credentials or corrupt existing configuration files. This document details the exact mechanics of the vulnerability, the structural root causes, and the corresponding mitigation path.

Root Cause Analysis

The primary root cause of this vulnerability lies in the lack of filesystem verification during the index-building and prompt-retrieval phases. When DirectoryPromptRegistry processes the directory tree, it iterates over all files matching the target suffix without checking if they are symbolic links. Standard Python library functions like path.open() or path.read_text() resolve symbolic links transparently at the operating system level, which allows the retrieval of files outside the designated registry path.

A secondary structural weakness exists in the write operations conducted during index updates and template modification. The registry uses direct filesystem writing methods that do not specify protection flags against symbolic link traversal. When a template is saved or the index is updated, the engine follows any pre-existing symbolic link mapped to the index or template filename, causing the application to write data to unintended external locations.

To exploit this behavior, an attacker must successfully plant symbolic links inside the folder configured as the prompt registry. This condition is commonly met in multi-tenant environments, content management systems, or platforms that extract compressed archive uploads without validating entry types. Once the links are in place, any subsequent read or write action performed by the application triggers the vulnerability, operating with the full permissions of the parent process.

Code Analysis

In vulnerable versions of the library, the registry resolves prompt paths using standard concatenation without checking for directory escape or symlink patterns. The _resolve_prompt_file function merely appended names to the root path, which is illustrated in the following diagram representing the data flow:

The patched version introduces explicit validations to verify path alignment and reject symbolic link structures. First, the library scans and verifies that files inside the registry root do not match symbolic links. In the _resolve_prompt_file function, the code now checks candidate.is_symlink() and raises an InvalidPromptError if a symlink is encountered.

# Patched implementation in directory.py
root = registry_root.resolve()
candidate = registry_root / f"{name}.{version}.jinja"
if candidate.is_symlink():
    msg = f"Prompt path is a symbolic link: {candidate}"
    raise InvalidPromptError(msg)
resolved = candidate.resolve()
if not resolved.is_relative_to(root):
    msg = f"Prompt path escapes registry root: {resolved}"
    raise InvalidPromptError(msg)

Additionally, write operations are secured against concurrent link manipulation using low-level file descriptors. The library utilizes os.O_NOFOLLOW on supported platforms to instruct the kernel to abort the write operation if the target path resolves to a link. This technique effectively closes the window of opportunity for symbolic link modification during file creation.

Exploitation Methodology

Exploitation of this vulnerability is achieved in two distinct modes depending on whether the target operation is a read or write action. In both scenarios, the primary prerequisite is the ability of the attacker to introduce symbolic links into the registry path. This prerequisite is met when the application processes uploaded zip files, untrusted git repositories, or shared filesystem directories.

For an arbitrary file read, the attacker creates a symbolic link that points to a target system file, such as /etc/passwd. The symbolic link is named to match the template naming convention, for example leak.0.jinja. When the application initializes the registry or updates the index, it scans the directory, follows the link, reads the contents of /etc/passwd, and stores the content in memory as the template body, making it retrievable by the attacker.

For an arbitrary file write, the attacker leverages the index update mechanism or the template storage routines. The attacker plants a symbolic link named index.json pointing to a target system configuration file or script. When the registry updates its internal index or saves a new prompt, the _save() routine writes the serialized data to index.json. The operating system follows the link, overwriting the target system file with the serialized index data, which can disrupt services or alter behavior.

Impact Assessment

The impact of CVE-2026-107716 is classified as high, as it permits both unauthorized read and write access to files on the host system. Through arbitrary file disclosure, an attacker can extract sensitive configuration profiles, private keys, database credentials, and environment files. The severity is determined by the privileges of the system user executing the application process.

Through arbitrary file write operations, the risk extends to application state corruption and potential control flow hijacking. By overwriting key configuration files, an attacker can disable security controls or redirect traffic. In environments where the application runs with elevated privileges, overwriting critical files like system crontabs or startup scripts can lead to code execution.

The CVSS v4.0 score is assessed at 7.3, reflecting high confidentiality and integrity impacts under local access conditions. Although direct local access is typically required to place the symlinks, remote exploitation remains possible if the application exposes file upload or archive extraction endpoints. The vulnerability is currently not listed on the CISA Known Exploited Vulnerabilities catalog, indicating no widespread active campaign.

Remediation and Mitigation Guidance

The primary remediation is upgrading the banks package to version 2.5.1 or later, which incorporates the path containment and symbolic link checks. This update modifies the scanning and writing processes to actively reject symbolic links and verify that resolved paths lie strictly within the registry directory. This blocks both read and write traversal techniques.

If upgrading immediately is not feasible, operational mitigations must be implemented to secure the directory contents. The prompt registry directory should be set to read-only for the application process during runtime, preventing the injection or modification of files. Any file upload, archive extraction, or remote repository synchronization feature must be strictly isolated and scanned to reject symlink files before they reach the registry path.

Developers should also audit application architectures to ensure that user-supplied templates are never directly stored in the filesystem registry. Implementing strict validation on template names and version strings prevents directory traversal sequences from bypassing basic check logic. These layers of defense ensure the application remains secure even if underlying library methods face unforeseen bypasses.

Official Patches

masciPull Request #79: Prevent symlinks in the prompt registry

Fix Analysis (1)

Technical Appendix

CVSS Score
7.3/ 10
CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N

Affected Systems

Applications using the masci/banks library with DirectoryPromptRegistry configured to read or write user-influenced templates

Affected Versions Detail

Product
Affected Versions
Fixed Version
banks
masci
< 2.5.12.5.1
AttributeDetail
CWE IDCWE-22, CWE-59
Attack VectorLocal
CVSS v4.07.3
EPSS ScoreN/A
ImpactArbitrary File Read / Arbitrary File Write
Exploit StatusNone/PoC
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1005Data from Local System
Collection
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') and Improper Link Resolution Before File Access ('Link Following')

Vulnerability Timeline

Pull Request #79 submitted and patch merged
2026-09-10
Release 2.5.1 published on PyPI
2026-09-10
Security Advisory published and CVE-2026-107716 assigned
2026-10-08

References & Sources

  • [1]GitHub Security Advisory GHSA-556j-vv39-8rqv
  • [2]NVD - CVE-2026-107716
  • [3]CVE-2026-107716 Record
  • [4]Patch Commit 23ed13e50b4e217693fa5f9c30943fac8a41582f
  • [5]Release Tag v2.5.1

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•36 minutes ago•CVE-2026-107394
6.8

CVE-2026-107394: Server-Side Request Forgery Bypass via Parser Differential in Indico

An incomplete Server-Side Request Forgery (SSRF) validation check in Indico prior to version 3.3.13 allows authenticated event organizers to bypass outbound network restrictions. By utilizing backslash characters within crafted URLs, attackers can exploit a parser differential between the application's validator and the downstream HTTP client library to access internal network resources.

Alon Barad
Alon Barad
1 views•6 min read
•about 2 hours ago•CVE-2026-107717
6.5

CVE-2026-107717: Chat Role Injection and Prompt Boundary Bypass in Banks Library

CVE-2026-107717 represents a critical prompt boundary bypass and chat role injection vulnerability in the Banks Python package (versions prior to 2.5.0). The library parses generated template outputs line-by-line, attempting to validate each segment as a JSON-serialized ChatMessage object without validating the source boundaries of the text. If an application integrates user input directly into a prompt template, a remote, unauthenticated attacker can supply multi-line inputs with structured JSON payloads. This input is then parsed as high-privilege system instructions or tool execution responses, completely hijacking downstream Large Language Model behavior.

Alon Barad
Alon Barad
7 views•6 min read
•about 4 hours ago•CVE-2026-107726
9.3

CVE-2026-107726: Unrestricted Deserialization in Hazelcast Zero Config Compact Serialization

Improper validation of dynamic class resolution within Hazelcast's Zero Config Compact Serialization allows unauthenticated clients to trigger reflective class instantiation. This flaw can be exploited to read arbitrary JVM heap or off-heap memory, crash cluster nodes, or achieve arbitrary code execution under specific classpath conditions. This issue is resolved in Hazelcast versions 5.4.5, 5.5.10, 5.6.1, and 5.7.0.

Alon Barad
Alon Barad
6 views•6 min read
•about 5 hours ago•CVE-2026-107719
4.2

CVE-2026-107719: Session Expiration Bypass in fast-jwt via Verifier Cache

An authentication bypass vulnerability in NearForm's fast-jwt before version 6.3.4 allows attackers to replay expired tokens due to an error in the verifier's cache expiration logic. When caching is enabled, the cache TTL defaults to 10 minutes instead of honoring the token's exp claim if the token lacks an iat claim.

Alon Barad
Alon Barad
7 views•7 min read
•about 6 hours ago•CVE-2026-61427
7.3

CVE-2026-61427: Authentication Bypass and Unvalidated Tool Execution in PraisonAI MCP HTTP-Stream Server

CVE-2026-61427 is a critical authentication bypass and improper input validation vulnerability within the Model Context Protocol (MCP) HTTP-stream server of PraisonAI. In versions prior to 4.6.78, the server lacks authentication by default and forwards client messages directly to Python tool handlers without input validation. When bound to non-localhost interfaces, this permits unauthenticated remote attackers to perform unauthorized administrative operations and execute tools.

Alon Barad
Alon Barad
8 views•4 min read
•about 7 hours ago•CVE-2026-107387
6.2

CVE-2026-107387: Uncontrolled Memory Allocation (OOM) in music-metadata APEv2 Parser

CVE-2026-107387 is a high-impact uncontrolled memory allocation vulnerability in music-metadata, a widely used Node.js metadata parser. The flaw occurs in the APEv2 tag parser, where the library reads an attacker-controlled 32-bit integer indicating the tag size and immediately requests a corresponding heap buffer reservation. Because this allocation occurs before validating if the input stream actually contains those bytes, an attacker can supply a minuscule audio file to trigger large, disproportionate allocations, resulting in heap exhaustion and an uncatchable process-wide Out of Memory (OOM) crash.

Amit Schendel
Amit Schendel
8 views•5 min read