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

PHP 5.5.13 / Lynis 1.5.4 Insecure /tmp Use

PHP 5.5.13 / Lynis 1.5.4 Insecure /tmp Use
Posted Jun 4, 2014
Authored by A B

PHP version 5.5.13 and Lynis version 1.5.4 use /tmp insecurely.

tags | advisory, php
SHA-256 | e8fd9a05110d214b1f51e304a9c367e55a2709149d4453dfa7eef7d72082bdfb

PHP 5.5.13 / Lynis 1.5.4 Insecure /tmp Use

Change Mirror Download
After reading about today's "Check, rootkit" vulnerability (CVE-2014-0476),
I thought I'd share these stupid bugs:

BUG #1 - PHP's ./configure script writes a predictable filename to /tmp
allowing for a symlink attack against the user running the script

>From PHP 5.5.13:

18045 #include <stdio.h>
18046 int main(int argc, char *argv[])
18047 {
18048 FILE *fp;
18049 long position;
18050 char *filename = "/tmp/phpglibccheck";
18051
18052 fp = fopen(filename, "w");
18053 if (fp == NULL) {
18054 perror("fopen");
18055 exit(2);
18056 }
18057 fputs("foobar", fp);
18058 fclose(fp);
18059
18060 fp = fopen(filename, "a+");
18061 position = ftell(fp);
18062 fclose(fp);
18063 unlink(filename);
18064 if (position == 0)
18065 return 1;
18066 return 0;
18067 }

Reported to security@php.net twice, no response ever received:
September 22, 2012
January 8, 2013

This issue goes back at least 10+ years, but no one configures/compiles PHP
as root and your files aren't important anyway.


BUG #2 - Lynis 1.5.4 (and presumably earlier) writes a predictable filename
to /tmp allowing for a symlink attack against the user running the script
Website: rootkit.nl

This utility, which is similar in nature to "chkrootkit" and "rkhunter" and
must be run as root, also writes a predictable filename to /tmp (you'll
have to win a race for this one). Unreported, because this is security
software. Therefore it is secure. (The logic is intentional. What's to
report?)


Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    0 Files
  • 12
    Sep 12th
    0 Files
  • 13
    Sep 13th
    0 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    0 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    0 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    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