# GHSA-9h6h-9g78-86f7: Yapscan's report receiver server vulnerable to path traversal and log injection

> Attackers can overwrite arbitrary files on the host via path traversal in the experimental report receiver server, leading to data loss.

- **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:** 29 Dec 2022
- **Also known as:** GO-2022-1204

## What is GHSA-9h6h-9g78-86f7?

GHSA-9h6h-9g78-86f7 is a path traversal vulnerability in github.com/fkie-cad/yapscan, published on 29 Dec 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact

If you make use of the **report receiver server** (experimental), a client may be able to forge requests such that arbitrary files on the host can be overwritten (subject to permissions of the yapscan server), leading to loss of data. This is particularly problematic if you do not authenticate clients and/or run the server with elevated permissions.

### Patches

Vulnerable versions:

- v0.18.0
- v0.19.0 (unreleased)

This problem is patched in version v0.19.1

### Workarounds

Update to the newer version is highly encouraged!

Measures to reduce the risk of this include authenticating clients (see `--client-ca` flag) and containerization of the yapscan server.

### References

The tracking issue is #35. There you can find the commits, fixing the issue.

## Which versions are affected by GHSA-9h6h-9g78-86f7?

3 open source packages ship an affected version, including github.com/fkie-cad/yapscan.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/fkie-cad/yapscan` | Go | From 0.18.0 | 0.19.1 |
| `github.com/fkie-cad/yapscan` | Go | From 0.18.0 | 0.19.1 |
| `github.com/fkie-cad/yapscan` | Go | From 0.18.0 | 0.19.1 |

## How do I fix GHSA-9h6h-9g78-86f7?

Upgrade github.com/fkie-cad/yapscan to 0.19.1 or later.

## Is GHSA-9h6h-9g78-86f7 being exploited?

There is no known exploitation of GHSA-9h6h-9g78-86f7 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-9h6h-9g78-86f7 and fix it if it is affected.

What it is: GHSA-9h6h-9g78-86f7 is a path traversal vulnerability in github.com/fkie-cad/yapscan, published on 29 Dec 2022. 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-9h6h-9g78-86f7 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/fkie-cad/yapscan (Go): affected from 0.18.0; fixed in 0.19.1
- github.com/fkie-cad/yapscan (Go): affected from 0.18.0; fixed in 0.19.1
- github.com/fkie-cad/yapscan (Go): affected from 0.18.0; fixed in 0.19.1

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-9h6h-9g78-86f7/ (Markdown: https://insights.sbomify.com/GHSA-9h6h-9g78-86f7/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-9h6h-9g78-86f7

---
From sbomify Insights: https://insights.sbomify.com/GHSA-9h6h-9g78-86f7/
Summaries are generated and may contain mistakes; the official description above is the record.
