exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

pmount 0.9.23 Arbitrary Device Mount

pmount 0.9.23 Arbitrary Device Mount
Posted Jul 13, 2016
Authored by Imre Rad

pmount is a wrapper around the standard mount program which permits normal users to mount removable devices without a matching /etc/fstab entry. Due to a missing input validation check local users could mount devices to arbitrary destinations and thus taking over the targeted system completely. Versions 0.9.23 is affected.

tags | exploit, arbitrary, local
SHA-256 | 2721035920e3ee68f9a9ba12f5b428e825d1682c57e62014bc2baa2e25fb29e5

pmount 0.9.23 Arbitrary Device Mount

Change Mirror Download
Summary:
--------
pmount is a wrapper around the standard mount program which permits
normal users to mount removable devices without a matching /etc/fstab entry.
Due to a missing input validation check local users could mount devices
to arbitrary destinations and thus taking over the targeted system
completely.

Prerequisites:
--------------
Local user access to the target
Pmount 0.9.23 or older to be installed (any version at time of writing
this report)
/media directory to be empty

Description:
------------
pmount is a wrapper around the standard mount program which permits
normal users to mount removable devices without a matching /etc/fstab entry.

The default build of the pmount command mounts the specified device
under /media/label where label is subdirectory of /media. Label can be
specified as a command line parameter of pmount, and it is the basename
of the device to be mounted if omitted.
The pmount binary has setuid flag and owned by root.

The pmount command as of version 0.9.23 misses a validation check of the
label argument: single dot (.) as label is accepted by pmount.

Pmount verifies whether the destination directory (normally
/media/label) is empty and refuses to mount if it is not.
Since the /media directory is usually populated with floppy and cdrom
directories in popular Linux distributions, the exploitability of this
vulnerability is probably low.

If the media dir is empty one can specify a simple dot as label, the
device is then mounted to /media then.
This is possible because the make_mountpoint_name() function in pmount.c
does not prevent this case.

Once this mount succeeded, the contents of the /media directory is
controlled by the attacker. Breaking out of /media restriction is then
possible by further invocation of pmount.
Although pmount verifies whether the specified destination path is empty
or not, the execv call with the mount command is not executed atomically
with the emptyness check. This is a Time of check time of use (TOCTOU)
problem, and as contents of the /media directory is already controlled
by the attacker, with appropriate timing
this can be exploited to mount to arbitrary destinations. This is
possible for example by replacing the empty directory of the label to a
symbolic link.

Status:
-------
The vulnerability is not addressed at the time of publishing this
disclosure.

Additional information:
-----------------------
Discovered by: Imre Rad
Reported on: 2016-03-21
Disclosure: 2016-07-13
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close