# File Read Vulnerability allows Attackers to Compromise S3 buckets using Prow

Prow signs S3 paths with attacker-controlled suffix; using `%2e%3f` comments out `/latest.txt` and signs the bucket base, listing and reading all objects.

- Payout: $250
- Severity: medium
- Program: Kubernetes
- Found by: stealthy
- Disclosed: 2023-04-25
- Write-up quality: 7/10
- Original: https://hackerone.com/reports/1485500
- Library page: https://bugbountylibrary.com/r/h1%3A1485500
- Tags: area:cloud domain:cloud impact:data-leak impact:internal-access kind:bounty platform:hackerone sev:medium tech:aws tech:s3 technique:chained vuln:access-control vuln:path-traversal

**Target:** Prow job-history S3 log viewer endpoint
**Root cause:** Prow appends `/latest.txt` to a user-supplied S3 path and signs it without validating the path, so an encoded `?` truncates the appended suffix and `/.` resolves to the bucket root.
**Steps:**
1. Visit `https://prow.falco.org/job-history/s3/falco-prow-logs/%2e%3f`
2. Prow builds `s3://falco-prow-logs/.?/latest.txt` and signs it
3. The `?` comments out `/latest.txt`, signing the bucket base path
4. Response lists every object in the bucket
5. Read any file via `https://prow.falco.org/job-history/s3/falco-prow-logs/any.valid.file%3f`
**How found:** During a pentest, noticed Prow appends `/latest.txt` to S3 URLs before signing; hypothesized an encoded `?` would comment out the suffix and `/.` would resolve to the bucket root.
**Exploitation:** Attacker requests the job-history endpoint with a crafted path containing `%2e%3f`; Prow signs the resulting S3 URL, and the signed URL returns the bucket listing and arbitrary object contents, dumping production data and old logs.
**Insight:** When a service appends a fixed suffix to a user-controlled path before signing/authorizing, try encoded `?`/`#` to truncate the suffix and `/.` or `..` to escape to the parent/bucket root.

## Proof of concept (copied exactly from the original report)

**Encoded dot and question mark to sign bucket base path**

```
https://prow.falco.org/job-history/s3/falco-prow-logs/%2e%3f
```

**Encoded question mark to read arbitrary bucket file**

```
https://prow.falco.org/job-history/s3/falco-prow-logs/any.valid.file%3f
```

