# GHSA-2gq2-m628-33xp: gregwar/rst Local File Inclusion Vulnerability

> An attacker can exploit inadequate input validation in the gregwar/rst library to include arbitrary files and read sensitive server data.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 May 2024

## What is GHSA-2gq2-m628-33xp?

GHSA-2gq2-m628-33xp is a path traversal vulnerability in gregwar/rst, published on 15 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A Local File Inclusion (LFI) vulnerability has been discovered in the gregwar/rst library, potentially exposing sensitive files on the server to unauthorized users. The issue arises from inadequate input validation, allowing an attacker to manipulate file paths and include arbitrary files.

## Which versions are affected by GHSA-2gq2-m628-33xp?

2 open source packages ship an affected version, including gregwar/rst.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `gregwar/rst` | Packagist | All versions | 1.0.3 |
| `gregwar/rst` | Packagist | All versions | 1.0.3 |

## How do I fix GHSA-2gq2-m628-33xp?

Upgrade gregwar/rst to 1.0.3 or later.

## Is GHSA-2gq2-m628-33xp being exploited?

There is no known exploitation of GHSA-2gq2-m628-33xp in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-2gq2-m628-33xp and fix it if it is affected.

What it is: GHSA-2gq2-m628-33xp is a path traversal vulnerability in gregwar/rst, published on 15 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-2gq2-m628-33xp in the wild and no public exploit code.

Affected packages and fixed versions:
- gregwar/rst (Packagist): affected all versions; fixed in 1.0.3
- gregwar/rst (Packagist): affected all versions; fixed in 1.0.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-2gq2-m628-33xp/ (Markdown: https://insights.sbomify.com/GHSA-2gq2-m628-33xp/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-2gq2-m628-33xp

---
From sbomify Insights: https://insights.sbomify.com/GHSA-2gq2-m628-33xp/
Summaries are generated and may contain mistakes; the official description above is the record.
