Skip to content
Access control Write-up Intermediate

How Two Logic Flaws Let Hackers Get Root on Linux in Seconds — CVE-2025–6018 and CVE-2025–6019 Explained

Two logic flaws in openSUSE's PAM stack and udisks2 allow a remote SSH user to spoof being physically present and then mount a malicious XFS image with setuid support during a resize, leading to root. An attacker with standard user access could chain these to gain root in seconds without memory corruption.

Aaron Follow

Published on systemweakness.com

💡 Not a Medium member? You can still read this article in full with(Click here)

Aaron, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the PAM stack trusts user-controlled environment variables to determine physical presence, and udisks2 fails to apply nosuid/nodev flags immediately during a filesystem resize.

Impact

An attacker with standard user access could gain root on affected systems, with the second bug being more widely applicable even without the first.

What the attacker needed

SSH access to a vulnerable openSUSE system; Standard user privileges; Ability to upload files

The fix

The text recommends applying patches and additional mitigations such as disabling pam_env in SSH sessions and restricting udisks polkit rules.

How it was found

  1. Log in via SSH to a vulnerable openSUSE box.
  2. Add XDG_SEAT and XDG_VTNR variables to ~/.pam_environment.
  3. Log out and back in to gain allow_active privileges.
  4. Upload a malicious XFS image containing a setuid-root shell.
  5. Trigger a resize with udisksctl, which mounts the image unsafely.
  6. Hold the mount open with a script and execute the shell to become root.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

This is about two mistakes in Linux software that let a normal user become the all-powerful root user. One mistake lets a remote user pretend they are sitting at the computer, and the other lets a disk tool briefly run a malicious program with full privileges. Together they allow a full takeover without needing any complex memory-corruption tricks.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by Aaron

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.