CVE-2019-7304

CRITICAL

Canonical snapd <2.37.1 - Command Injection

Title source: llm
STIX 2.1

Exploitation Summary

EIP tracks 9 public exploits for CVE-2019-7304. PoCs published by Chris Moberly, initstring, SecuritySi.

AI-analyzed exploit summary This exploit leverages a vulnerability in snapd (CVE-2019-7304) to achieve local privilege escalation on Ubuntu systems. It bypasses access control checks to use restricted API functions, either creating a user via Ubuntu SSO or installing a malicious snap with an install hook.

Description

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.

Exploits (9)

exploitdb WORKING POC
by Chris Moberly · pythonlocallinux
https://www.exploit-db.com/exploits/46362

This exploit leverages a vulnerability in snapd (CVE-2019-7304) to achieve local privilege escalation on Ubuntu systems. It bypasses access control checks to use restricted API functions, either creating a user via Ubuntu SSO or installing a malicious snap with an install hook.

Classification
Working Poc 100%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: snapd < 2.37.1
No auth needed
Prerequisites: Local access to a vulnerable system · For v1: Outbound internet connection and SSH service running on localhost · For v2: None beyond local access
devstral-2 · analyzed Feb 16, 2026 Full analysis →
exploitdb WORKING POC
by Chris Moberly · pythonlocallinux
https://www.exploit-db.com/exploits/46361

This exploit leverages a vulnerability in snapd (CVE-2019-7304) to achieve local privilege escalation on Ubuntu systems. It manipulates the snapd API to create a new user with sudo rights by exploiting insecure parsing of UNIX socket peer data.

Classification
Working Poc 100%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: snapd versions before 2.37.1
No auth needed
Prerequisites: Outbound internet access (for v1) · SSH service running and accessible from localhost (for v1) · Ubuntu SSO account with configured SSH key (for v1)
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 683 stars
by initstring · poc
https://github.com/initstring/dirty_sock

This repository contains two Python-based privilege escalation exploits (dirty_sockv1.py and dirty_sockv2.py) targeting CVE-2019-7304, a vulnerability in snapd's API access control. The exploits leverage improper socket permission handling to create a local user with sudo rights via either Ubuntu SSO integration (v1) or arbitrary snap installation (v2).

Classification
Working Poc 100%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: snapd < 2.37.1
No auth needed
Prerequisites: Local access to a vulnerable system · For v1: Outbound internet access and SSH service running on localhost · For v2: None beyond local access
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 6 stars
by SecuritySi · poc
https://github.com/SecuritySi/CVE-2019-7304_DirtySock

This PoC generates a malicious snap package to exploit CVE-2019-7304 (Dirty Sock), a local privilege escalation vulnerability in snapd. It creates a snap with an install hook that adds a new sudo user with a specified password, leveraging snapd's improper handling of socket permissions.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: snapd (versions before 2.37.1)
No auth needed
Prerequisites: Local access to a vulnerable system · snapd installed · snapcraft installed
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 1 stars
by f4T1H21 · poc
https://github.com/f4T1H21/dirty_sock

This is a remastered local privilege escalation (LPE) exploit for CVE-2019-7304, targeting a vulnerability in snapd. The exploit creates a malicious snap package, installs it with elevated privileges, and then abuses it to gain root access by modifying the bash binary's permissions.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: snapd (versions prior to fix for CVE-2019-7304)
Auth required
Prerequisites: Local access to a vulnerable system · snapd installed and running · sudo privileges to install snaps
devstral-2 · analyzed Feb 16, 2026 Full analysis →
nomisec WORKING POC 1 stars
by elvi7major · poc
https://github.com/elvi7major/snap_priv_esc

This exploit leverages CVE-2019-7304 to escalate privileges via snapd by creating a malicious snap package with a custom install hook. The hook adds a user with sudo privileges, allowing the attacker to gain root access.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: snapd (versions affected by CVE-2019-7304)
Auth required
Prerequisites: snap installed on the system · sudo access to the snap command
devstral-2 · analyzed Feb 16, 2026 Full analysis →
gitlab WORKING POC
by initstring · poc
https://gitlab.com/initstring/dirty_sock

This repository contains functional exploit code for CVE-2019-7304, a local privilege escalation vulnerability in snapd affecting Ubuntu and other Linux distributions. The exploit leverages improper access control in the snapd API to create a privileged user account either via Ubuntu SSO integration (v1) or by installing a malicious snap package (v2).

Classification
Working Poc 100%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: snapd < 2.37.1
No auth needed
Prerequisites: snapd installed · local access to vulnerable system · for v1: outbound internet and SSH service running
devstral-2 · analyzed Feb 23, 2026 Full analysis →
gitlab WORKING POC
by f4T1H21 · poc
https://gitlab.com/f4T1H21/dirty_sock

This repository contains a functional local privilege escalation (LPE) exploit for CVE-2019-7304, targeting a vulnerability in snapd. The exploit creates a malicious snap package, installs it with elevated privileges, and then abuses it to gain root access by modifying the bash binary's permissions.

Classification
Working Poc 95%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: snapd (versions prior to fix for CVE-2019-7304)
No auth needed
Prerequisites: snapd installed · local user access
devstral-2 · analyzed Feb 23, 2026 Full analysis →
nomisec WRITEUP
by coby-nguyen · poc
https://github.com/coby-nguyen/Document-Linux-Privilege-Escalation

This repository documents the exploitation of CVE-2019-7304 (Dirty_Sock), a privilege escalation vulnerability in snapd versions older than 2.37. It describes the setup, exploitation steps, and impact of the vulnerability, which allows a local attacker to gain root access by manipulating the snapd REST API.

Classification
Writeup 100%
Attack Type
Lpe
Complexity
Moderate
Reliability
Reliable
Target: snapd < 2.37
No auth needed
Prerequisites: Local access to a vulnerable system · snapd service running · Ubuntu 16.04 or similar vulnerable OS
devstral-2 · analyzed Feb 16, 2026 Full analysis →

References (3)

Core 3
Core References
Vendor Advisory x_refsource_misc
https://usn.ubuntu.com/3887-1/
Exploit, Third Party Advisory, VDB Entry x_refsource_misc
https://www.exploit-db.com/exploits/46361
Exploit, Third Party Advisory, VDB Entry x_refsource_misc
https://www.exploit-db.com/exploits/46362

Scores

CVSS v3 9.8
EPSS 0.6108
EPSS Percentile 99.0%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Details

CWE
CWE-863
Status published
Products (5)
canonical/snapd < 2.37.1
canonical/ubuntu_linux 14.04
canonical/ubuntu_linux 16.04
canonical/ubuntu_linux 18.04
canonical/ubuntu_linux 18.10
Published Apr 23, 2019
Tracked Since Feb 18, 2026