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:

July 2024

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