cbcvebase.
CVE-2019-7304
published 2019-04-23

CVE-2019-7304: Canonical snapd before version 2.37.1 incorrectly performed socket owner validation, allowing an attacker to run arbitrary commands as root. This issue…

PriorityP276critical9.8CVSS 3.1
AVNACLPRNUINSUCHIHAH
EXPLOIT
EPSS
57.48%
99.0th percentile
Canonical snapd before version 2.37.1 incorrectly performed socket owner validation, allowing an attacker to run arbitrary commands as root. This issue affects: Canonical snapd versions prior to 2.37.1.

Affected

11 ranges
VendorProductVersion rangeFixed in
canonicalsnapd< 2.37.12.37.1
canonicalsnapd>= unspecified < 2.37.12.37.1
canonicalubuntu_linux
canonicalubuntu_linux
canonicalubuntu_linux
canonicalubuntu_linux
debiansnapd< snapd 2.37.1-1 (bookworm)snapd 2.37.1-1 (bookworm)
snapcraftsnapd>= 0 < 2.37.1-12.37.1-1
snapcraftsnapd>= 0 < 2.37.1-12.37.1-1
snapcraftsnapd>= 0 < 2.37.1-12.37.1-1
snapcraftsnapd>= 0 < 2.37.1-12.37.1-1

Detection & IOCsextracted from sources · hover to see the quote

path/tmp/<random10chars>;uid=0;
path/run/snapd.socket
urlPOST /v2/create-user
urlPOST /v2/snaps
commandPOST /v2/create-user HTTP/1.1 Host: localhost Content-Length: ... {"email": "...", "sudoer": true, "force-managed": true}
other;uid=0;
  • Detect exploit socket file creation: monitor for UNIX socket files in /tmp/ whose filename contains the pattern ';uid=0;' — this is the core injection string used to spoof UID in snapd's ucrednet.go peer data parsing.
  • Alert on connections to /run/snapd.socket from processes whose socket file path contains ';uid=0;', indicating dirty_sock exploitation attempt.
  • Monitor for installation of 'devmode' snaps via POST /v2/snaps from local unprivileged users — v2 of the exploit installs a trojan devmode snap with an install hook running as root.
  • Detect creation of a new local user named 'dirty_sock' with sudo rights — this is the default account created by dirty_sockv2 upon successful exploitation.
  • The vulnerability resides in snapd's ucrednet.go socket peer data parsing; the injected string ';uid=0;' in the socket filename overwrites the UID variable. Audit snapd versions 2.28 through 2.37 as vulnerable.
  • ·Exploit v1 requires an outbound Internet connection (to query Ubuntu SSO) and SSH service accessible via localhost; v2 works without Internet or SSH but requires snapd sideloading components.
  • ·On Ubuntu systems with snaps installed, snapd may have already auto-updated to the patched version 2.37.1; verify with 'snap version' before testing.
  • ·On older Ubuntu systems (e.g., 16.04), v2 exploit may trigger installation of missing snapd sideloading dependencies, which could cause snapd to upgrade itself to a non-vulnerable version — yet testing shows the exploit still succeeds in this scenario.

CVSS provenance

nvdv3.19.8CRITICALCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvdv3.08.8HIGHCVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
nvdv2.010.0CRITICALAV:N/AC:L/Au:N/C:C/I:C/A:C
osv9.8CRITICAL
vendor_debian9.8CRITICAL
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.