GHSA-wxhm-2mq7-7697: Path Traversal
Summary Prompty loaders expanded ${file:...} references in .prompty frontmatter without enforcing that the resolved path stayed within an authorized directory. An attacker-controlled prompt file could use path traversal or an absolute path to cause the host application to read files accessible to the process.
Affected packages - PyPI prompty versions <= 2.0.0b1; fixed in 2.0.0b2 - npm @prompty/core versions <= 2.0.0-beta.1; fixed in 2.0.0-beta.2 - crates.io prompty versions <= 2.0.0-beta.1; fixed in 2.0.0-beta.2 - NuGet Prompty.Core versions <= 2.0.0-beta.1; fixed in 2.0.0-beta.2
Impact Applications that load untrusted .prompty files, user-provided prompt paths, or prompt bundles from less-trusted locations could disclose local files available to the application process when expanded values are logged, returned, or otherwise exposed.
Remediation Upgrade to the fixed runtime version for your ecosystem. The fix makes file references secure by default: ${file:...} may only resolve within the directory tree containing the .prompty file. Host applications that need shared prompt assets outside that tree must explicitly provide allowed file roots through runtime load options. Absolute paths, .. traversal, and symlink escapes outside allowed roots are rejected.
Fix details The patched runtimes canonicalize file-reference targets and allowed roots before reading referenced files, reject targets outside the prompt directory by default, and add regression coverage for traversal, absolute paths, explicit allowlists, and symlink escapes. The release commit is 88ac9948d7d37995edbb2f6d36913436626c39e1.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
nuget/Prompty.Coreto a version that resolves this vulnerability.Fixed in 2.0.0-beta.2 - Upgrade
Upgrade
rust/promptyto a version that resolves this vulnerability.Fixed in 2.0.0-beta.2 - Upgrade
Upgrade
npm/@prompty/coreto a version that resolves this vulnerability.Fixed in 2.0.0-beta.2 - Upgrade
Upgrade
pip/promptyto a version that resolves this vulnerability.Fixed in 2.0.0b2 - Upgrade
Upgrade
NuGet Prompty.Coreto a version that resolves this vulnerability.Fixed in 2.0.0-beta.2 - Upgrade
Upgrade
PyPI promptyto a version that resolves this vulnerability.Fixed in 2.0.0b2 - Upgrade
Upgrade
crates.io promptyto a version that resolves this vulnerability.Fixed in 2.0.0-beta.2 - Upgrade
Upgrade
npm @prompty/coreto a version that resolves this vulnerability.Fixed in 2.0.0-beta.2 - Compensating control
If your host application needs shared prompt assets outside the prompt directory tree, explicitly provide allowed file roots through runtime load options so `${file:...}` resolves only within authorized directories (since `${file:...}` is secure-by-default and rejects targets outside the `.prompty` directory tree).
- Compensating control
Do not load untrusted `.prompty` files, user-provided prompt paths, or prompt bundles from less-trusted locations without restricting/validating their source and allowed file roots, because `${file:...}` expansion could otherwise expose local files available to the application process.
Event History
Frequently Asked Questions
What is the severity of GHSA-wxhm-2mq7-7697?
The severity of GHSA-wxhm-2mq7-7697 is rated high with a score of 7.5.
How does GHSA-wxhm-2mq7-7697 allow an attacker to exploit a system?
GHSA-wxhm-2mq7-7697 enables an attacker to leverage path traversal or absolute paths through user-controlled prompt files to read unauthorized files.
Which software packages are affected by GHSA-wxhm-2mq7-7697?
Software packages affected by GHSA-wxhm-2mq7-7697 include nuget/Prompty.Core, rust/prompty, npm/@prompty/core, and pip/prompty.
What type of security vulnerabilities does GHSA-wxhm-2mq7-7697 involve?
GHSA-wxhm-2mq7-7697 involves path traversal and information leakage vulnerabilities.
How can I mitigate GHSA-wxhm-2mq7-7697?
Mitigation for GHSA-wxhm-2mq7-7697 includes ensuring file path resolution remains within authorized directories when using prompt files.