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:

August 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close