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·98 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

•2 days ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.

Alon Barad
Alon Barad
11 views•10 min read
•2 days ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.

Alon Barad
Alon Barad
14 views•12 min read
•2 days ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.

Alon Barad
Alon Barad
6 views•12 min read
•2 days ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.

Amit Schendel
Amit Schendel
15 views•10 min read
•2 days ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.

Alon Barad
Alon Barad
19 views•10 min read
•2 days ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.

Amit Schendel
Amit Schendel
8 views•9 min read