CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-40162

CVE-2026-40162: Authenticated Arbitrary File Write in Bugsink Artifact Assembly

Alon Barad
Alon Barad
Software Engineer

Apr 10, 2026·6 min read·82 visits

Executive Summary (TL;DR)

Bugsink 2.1.0 fails to sanitize the `checksum` parameter during artifact bundle assembly, permitting authenticated attackers to write arbitrary files via path traversal. This leads to remote code execution. The vulnerability is fixed in version 2.1.1.

An authenticated arbitrary file write vulnerability exists in Bugsink 2.1.0 within the artifact bundle assembly workflow. Attackers can leverage the `checksum` parameter to execute path traversal attacks, allowing the writing of arbitrary data to the filesystem before the application validates the checksum.

Vulnerability Overview

Bugsink is a self-hosted error tracking tool. Version 2.1.0 introduces a high-severity arbitrary file write vulnerability within the artifact bundle assembly workflow. The flaw centers on the application's failure to properly sanitize user input during temporary file creation.

The vulnerable endpoint resides at /api/0/organizations/{org}/artifactbundle/assemble/. The application relies on client-provided checksums to verify the integrity of uploaded chunks. However, the system utilizes this checksum directly as a filename component when constructing temporary storage paths.

Successful exploitation requires valid authentication credentials and access to the Bugsink API. An attacker can manipulate the checksum parameter to include path traversal sequences. This allows the writing of malicious payloads to arbitrary locations on the filesystem writable by the Bugsink process.

Version 2.1.1 resolves this issue. The patched version abandons named temporary files derived from user input in favor of anonymous unlinked file descriptors. This architectural change eliminates the path traversal vector entirely.

Root Cause Analysis

The root cause of CVE-2026-40162 is the improper limitation of a pathname to a restricted directory (CWE-22) combined with improper input validation (CWE-20). The application blindly trusts the user-supplied checksum string when managing file I/O operations in files/tasks.py.

During the artifact bundle assembly process, Bugsink iterates over previously uploaded file chunks and concatenates them. The application allocates a local filesystem path for this concatenated file using Path(tempdir, checksum). At this stage, no validation confirms that the user-provided checksum is a valid cryptographic hash or that it resolves safely within tempdir.

The application proceeds to write the combined chunk data to this attacker-controlled path. The critical flaw is a timing and logic error: the system only hashes the assembled file and compares it to the user's checksum after the write operation completes.

When the post-write validation inevitably fails due to the checksum mismatch, the application raises an exception and aborts the transaction. However, the filesystem modification has already occurred. The application does not revert or clean up the maliciously placed file, resulting in a permanent arbitrary file write.

Code Analysis

Examining the vulnerable code path in files/tasks.py highlights the direct use of unsanitized input in filesystem operations. The application takes the checksum parameter from the JSON payload and passes it directly to the Path constructor.

# Vulnerable implementation in Bugsink 2.1.0
local_path = Path(tempdir, checksum)
 
# Application writes chunk data to local_path
write_chunks_to_file(chunks, local_path)
 
# Validation occurs too late, file is already written
if checksum_state.hexdigest() != checksum:
    raise Exception("checksum mismatch")

The fix implemented in commit 29e46f3737b15f6045073fb145ec936499e232f6 refactors this logic. The maintainers replaced the predictable, user-controlled named file with an anonymous temporary file descriptor provided by the standard library.

# Patched implementation in Bugsink 2.1.1
with tempfile.TemporaryFile(dir=tempdir) as local_file:
    # Application writes chunk data to the unlinked local_file descriptor
    write_chunks_to_file(chunks, local_file)
    
    # Validation occurs on the file descriptor before moving it to permanent storage
    if checksum_state.hexdigest() != checksum:
        raise Exception("checksum mismatch")

By utilizing tempfile.TemporaryFile, the operating system creates an anonymous unlinked file. The user input no longer influences the filesystem path, closing the path traversal vector. The checksum is now solely used for its intended purpose: post-assembly integrity validation.

Exploitation Methodology

Exploitation relies on a sequence of standard API interactions combined with a path traversal payload. An attacker must possess valid authentication headers to communicate with the Bugsink instance. The attack maps to MITRE ATT&CK technique T1190 (Exploit Public-Facing Application).

The attacker first uploads a sequence of malicious file chunks containing the intended payload, such as a Python reverse shell or an SSH public key. The server stores these chunks and returns identifiers to the attacker.

The attacker then sends a POST request to /api/0/organizations/{org}/artifactbundle/assemble/. Instead of providing a valid SHA1 hash for the checksum field, the attacker supplies a relative path traversal string, such as ../../../../opt/bugsink/settings.py.

The following Python proof-of-concept snippet demonstrates the precise payload structure required to trigger the vulnerability, as extracted from the official regression test in commit 1fc1076686792bdc66d97d079d1750e26a06d242.

# Extract from Bugsink regression test (Commit 1fc1076686)
self.client.post(
    "/api/0/organizations/anyorg/artifactbundle/assemble/",
    json.dumps({
        "checksum": "../../../../tmp/malicious.txt", 
        "chunks": [real_checksum], 
        "projects": ["unused"]
    }),
    content_type="application/json",
    headers=self.token_headers,
)

Impact Assessment

The vulnerability carries a CVSS v3.1 base score of 7.1, categorized as High severity. The core impact is a severe loss of integrity, allowing attackers to write or overwrite any file the Bugsink application process has permissions to modify.

In standard deployments, the arbitrary file write directly facilitates Remote Code Execution (RCE). An attacker can overwrite executable application files, such as .py source code or module initialization scripts. When the application server restarts or spawns a new worker, the malicious code executes automatically.

If the Bugsink application runs with elevated privileges or has overly broad filesystem permissions, the impact expands to complete system compromise. Attackers can write malicious entries to /etc/crontab or deploy SSH keys into the authorized_keys file of the application user.

The confidentiality impact is initially low, as the vulnerability does not directly expose data. However, successful RCE grants the attacker full access to the database credentials, application secrets, and any error telemetry data stored within the Bugsink environment.

Remediation and Mitigation

The only complete remediation for CVE-2026-40162 is updating to Bugsink version 2.1.1. This release implements the structural changes required to separate user-provided integrity metadata from filesystem path construction.

Organizations unable to deploy the patch immediately must implement mitigation controls at the ingress point. Web Application Firewalls (WAF) should be configured to inspect POST payloads directed at /api/0/organizations/*/artifactbundle/assemble/ and /api/0/organizations/*/file/assemble/.

The WAF rule must strictly validate the checksum parameter against a restrictive regular expression. Specifically, the payload must drop any request where the checksum is not a 40-character hexadecimal string (^[a-fA-F0-9]{40}$). This explicitly prevents the inclusion of directory traversal sequences like ../.

Security operations teams should monitor application logs for anomalous behavior. A high volume of HTTP 500 errors originating from the assembly endpoints, coupled with repeated "checksum mismatch" internal application errors, is a strong indicator of active exploitation attempts.

Official Patches

BugsinkRelease Notes for Bugsink 2.1.1
BugsinkCore Patch Commit

Fix Analysis (2)

Technical Appendix

CVSS Score
7.1/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L

Affected Systems

Bugsink 2.1.0

Affected Versions Detail

Product
Affected Versions
Fixed Version
Bugsink
Bugsink
2.1.02.1.1
AttributeDetail
CWE IDCWE-22, CWE-20
Attack VectorNetwork
CVSS Score7.1 (High)
ImpactArbitrary File Write / Remote Code Execution
Exploit StatusProof of Concept
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-22
Path Traversal

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Known Exploits & Detection

GitHub (Regression Test)Official unit test demonstrating the path traversal payload

Vulnerability Timeline

Bugsink 2.1.0 released (vulnerable version introduced)
2026-04-04
Core security fix for arbitrary file write committed
2026-04-09
Bugsink 2.1.1 released
2026-04-09
CVE-2026-40162 publicly disclosed
2026-04-10

References & Sources

  • [1]GHSA-8hw4-fhww-273g Advisory
  • [2]Bugsink 2.1.1 Release Notes
  • [3]Core Fix Commit
  • [4]Regression Test Commit

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•28 minutes ago•CVE-2026-92941
10.0

CVE-2026-92941: Sandbox Escape and Process-Wide TLS Trust Store Manipulation in vm2

CVE-2026-92941 is a critical sandbox-escape and trust-manipulation vulnerability in the vm2 library (versions 3.11.3 to 3.11.6). This security flaw allows untrusted code executing within a NodeVM sandbox environment to compromise the global TLS trust store of the host Node.js process. By leveraging a design flaw where the host's native 'tls.setDefaultCACertificates' can be executed via a proxy wrapper, combined with a bridge unwrapping bypass in the 'url' module, an attacker can modify the process-wide default root Certificate Authorities. Consequently, all subsequent outbound TLS/HTTPS clients running on the host thread are forced to trust attacker-signed certificates, facilitating transparent Man-in-the-Middle (MitM) attacks. The vulnerability was resolved in version 3.11.7 of vm2 by introducing built-in member-level sanitization before applying read-only proxy wrappers.

Amit Schendel
Amit Schendel
1 views•10 min read
•about 1 hour ago•CVE-2026-92944
9.8

CVE-2026-92944: Sandbox Escape in vm2 via Stale V8 PromiseThenLookupChain Protector

A critical engine-level reachability failure in Node.js 26 running V8 14.6 allows attackers to escape the vm2 sandbox environment. When consecutive prototype properties are modified using sequential assignments, a V8 optimization bug fails to invalidate the PromiseThenLookupChain protector. By calling Promise.prototype.finally, the attacker bypasses the vm2 wrappers, hijacks the promise reaction using a custom constructor, triggers a calibrated stack overflow to capture a host-realm RangeError, and executes arbitrary shell commands on the host.

Alon Barad
Alon Barad
3 views•8 min read
•about 2 hours ago•CVE-2026-92939
9.9

CVE-2026-92939: Critical Sandbox Escape via Host Crypto setEngine Native Code Execution in vm2

A critical sandbox escape vulnerability in the vm2 library allows sandboxed JavaScript code to bypass containment and execute arbitrary native code on the host process. This occurs when the host's builtin crypto module is exposed to the NodeVM environment. Although vm2 implements a read-only proxy layer to restrict direct modifications to host properties, it does not prevent invocation of host-level functions. By calling the crypto.setEngine API with a path to a malicious native library on disk, an attacker can trigger OpenSSL's dynamic module loader. The host's operating system loader immediately runs the dynamic library's initializers/constructors before verifying engine compatibility, leading to remote code execution in the context of the host process.

Amit Schendel
Amit Schendel
4 views•5 min read
•about 3 hours ago•CVE-2026-92938
9.9

CVE-2026-92938: Remote Code Execution in vm2 via node:sqlite DatabaseSync Sandbox Escape

CVE-2026-92938 is a critical sandbox escape vulnerability in the vm2 library (versions 3.11.3 through 3.11.6) that allows arbitrary native code execution on the host when the node:sqlite built-in module is loaded inside a sandboxed NodeVM environment.

Amit Schendel
Amit Schendel
6 views•8 min read
•about 4 hours ago•CVE-2026-92937
10.0

CVE-2026-92937: Sandbox Escape leading to Remote Code Execution via Promise Indirection in vm2

CVE-2026-92937 is a critical sandbox escape vulnerability in the `vm2` Node.js library. Due to a logical failure in checking direct invocation targets inside the Proxy bridge, an attacker can register Promise callbacks using `Function.prototype.call` or `Function.prototype.apply` indirection. This bypasses the error sanitization wrappers, delivering raw host error objects directly to sandboxed callbacks and allowing the attacker to escape the sandbox and execute arbitrary shell commands on the host.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 5 hours ago•CVE-2026-92935
9.5

CVE-2026-92935: Remote Code Execution via Array-Shaped Require Config in vm2 NodeVM Sandbox

CVE-2026-92935 is a critical sandbox escape and remote code execution vulnerability in the vm2 library. By supplying an array or exotic object to the require property of NodeVM while nesting is enabled, attackers can bypass security checks, load the host vm2 module, and run arbitrary shell commands on the hosting server.

Alon Barad
Alon Barad
5 views•7 min read