Vulnerabilities > CVE-2008-3162 - Improper Restriction of Operations Within the Bounds of A Memory Buffer vulnerability in Ffmpeg

047910
CVSS 9.3 - CRITICAL
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
COMPLETE
Integrity impact
COMPLETE
Availability impact
COMPLETE
network
ffmpeg
CWE-119
critical
nessus
exploit available

Summary

Stack-based buffer overflow in the str_read_packet function in libavformat/psxstr.c in FFmpeg before r13993 allows remote attackers to cause a denial of service (application crash) or execute arbitrary code via a crafted STR file that interleaves audio and video sectors.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Buffer Overflow via Environment Variables
    This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
  • Overflow Buffers
    Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
  • Client-side Injection-induced Buffer Overflow
    This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service.
  • Filter Failure through Buffer Overflow
    In this attack, the idea is to cause an active filter to fail by causing an oversized transaction. An attacker may try to feed overly long input strings to the program in an attempt to overwhelm the filter (by causing a buffer overflow) and hoping that the filter does not fail securely (i.e. the user input is let into the system unfiltered).
  • MIME Conversion
    An attacker exploits a weakness in the MIME conversion routine to cause a buffer overflow and gain control over the mail server machine. The MIME system is designed to allow various different information formats to be interpreted and sent via e-mail. Attack points exist when data are converted to MIME compatible format and back.

Exploit-Db

descriptionFFmpeg libavformat 'psxstr.c' STR Data Heap Based Buffer Overflow Vulnerability. CVE-2008-3162. Dos exploit for linux platform
idEDB-ID:32019
last seen2016-02-03
modified2008-07-09
published2008-07-09
reporterastrange
sourcehttps://www.exploit-db.com/download/32019/
titleFFmpeg libavformat 'psxstr.c' STR Data Heap Based Buffer Overflow Vulnerability

Nessus

  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-630-1.NASL
    descriptionIt was discovered that ffmpeg did not correctly handle STR file demuxing. If a user were tricked into processing a malicious STR file, a remote attacker could execute arbitrary code with user privileges via applications linked against ffmpeg. Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id33759
    published2008-07-29
    reporterUbuntu Security Notice (C) 2008-2019 Canonical, Inc. / NASL script (C) 2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/33759
    titleUbuntu 7.10 / 8.04 LTS : ffmpeg vulnerability (USN-630-1)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from Ubuntu Security Notice USN-630-1. The text 
    # itself is copyright (C) Canonical, Inc. See 
    # <http://www.ubuntu.com/usn/>. Ubuntu(R) is a registered 
    # trademark of Canonical, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(33759);
      script_version("1.13");
      script_cvs_date("Date: 2019/08/02 13:33:02");
    
      script_cve_id("CVE-2008-3162");
      script_xref(name:"USN", value:"630-1");
    
      script_name(english:"Ubuntu 7.10 / 8.04 LTS : ffmpeg vulnerability (USN-630-1)");
      script_summary(english:"Checks dpkg output for updated packages.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:
    "The remote Ubuntu host is missing one or more security-related
    patches."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "It was discovered that ffmpeg did not correctly handle STR file
    demuxing. If a user were tricked into processing a malicious STR file,
    a remote attacker could execute arbitrary code with user privileges
    via applications linked against ffmpeg.
    
    Note that Tenable Network Security has extracted the preceding
    description block directly from the Ubuntu security advisory. Tenable
    has attempted to automatically clean and format it as much as possible
    without introducing additional issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://usn.ubuntu.com/630-1/"
      );
      script_set_attribute(attribute:"solution", value:"Update the affected packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:C/I:C/A:C");
      script_cwe_id(119);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:ffmpeg");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libavcodec-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libavcodec1d");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libavformat-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libavformat1d");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libavutil-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libavutil1d");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libpostproc-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libpostproc1d");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libswscale-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:canonical:ubuntu_linux:libswscale1d");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:7.10");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:canonical:ubuntu_linux:8.04:-:lts");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2008/07/28");
      script_set_attribute(attribute:"plugin_publication_date", value:"2008/07/29");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"Ubuntu Security Notice (C) 2008-2019 Canonical, Inc. / NASL script (C) 2018 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Ubuntu Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/cpu", "Host/Ubuntu", "Host/Ubuntu/release", "Host/Debian/dpkg-l");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("ubuntu.inc");
    include("misc_func.inc");
    
    if ( ! get_kb_item("Host/local_checks_enabled") ) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/Ubuntu/release");
    if ( isnull(release) ) audit(AUDIT_OS_NOT, "Ubuntu");
    release = chomp(release);
    if (! ereg(pattern:"^(7\.10|8\.04)$", string:release)) audit(AUDIT_OS_NOT, "Ubuntu 7.10 / 8.04", "Ubuntu " + release);
    if ( ! get_kb_item("Host/Debian/dpkg-l") ) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if ("x86_64" >!< cpu && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Ubuntu", cpu);
    
    flag = 0;
    
    if (ubuntu_check(osver:"7.10", pkgname:"ffmpeg", pkgver:"0.cvs20070307-5ubuntu4.1")) flag++;
    if (ubuntu_check(osver:"7.10", pkgname:"libavcodec-dev", pkgver:"0.cvs20070307-5ubuntu4.1")) flag++;
    if (ubuntu_check(osver:"7.10", pkgname:"libavcodec1d", pkgver:"0.cvs20070307-5ubuntu4.1")) flag++;
    if (ubuntu_check(osver:"7.10", pkgname:"libavformat-dev", pkgver:"0.cvs20070307-5ubuntu4.1")) flag++;
    if (ubuntu_check(osver:"7.10", pkgname:"libavformat1d", pkgver:"3:0.cvs20070307-5ubuntu4.1")) flag++;
    if (ubuntu_check(osver:"7.10", pkgname:"libavutil-dev", pkgver:"0.cvs20070307-5ubuntu4.1")) flag++;
    if (ubuntu_check(osver:"7.10", pkgname:"libavutil1d", pkgver:"0.cvs20070307-5ubuntu4.1")) flag++;
    if (ubuntu_check(osver:"7.10", pkgname:"libpostproc-dev", pkgver:"0.cvs20070307-5ubuntu4.1")) flag++;
    if (ubuntu_check(osver:"7.10", pkgname:"libpostproc1d", pkgver:"0.cvs20070307-5ubuntu4.1")) flag++;
    if (ubuntu_check(osver:"7.10", pkgname:"libswscale-dev", pkgver:"0.cvs20070307-5ubuntu4.1")) flag++;
    if (ubuntu_check(osver:"7.10", pkgname:"libswscale1d", pkgver:"0.cvs20070307-5ubuntu4.1")) flag++;
    if (ubuntu_check(osver:"8.04", pkgname:"ffmpeg", pkgver:"0.cvs20070307-5ubuntu7.1")) flag++;
    if (ubuntu_check(osver:"8.04", pkgname:"libavcodec-dev", pkgver:"0.cvs20070307-5ubuntu7.1")) flag++;
    if (ubuntu_check(osver:"8.04", pkgname:"libavcodec1d", pkgver:"0.cvs20070307-5ubuntu7.1")) flag++;
    if (ubuntu_check(osver:"8.04", pkgname:"libavformat-dev", pkgver:"0.cvs20070307-5ubuntu7.1")) flag++;
    if (ubuntu_check(osver:"8.04", pkgname:"libavformat1d", pkgver:"3:0.cvs20070307-5ubuntu7.1")) flag++;
    if (ubuntu_check(osver:"8.04", pkgname:"libavutil-dev", pkgver:"0.cvs20070307-5ubuntu7.1")) flag++;
    if (ubuntu_check(osver:"8.04", pkgname:"libavutil1d", pkgver:"0.cvs20070307-5ubuntu7.1")) flag++;
    if (ubuntu_check(osver:"8.04", pkgname:"libpostproc-dev", pkgver:"0.cvs20070307-5ubuntu7.1")) flag++;
    if (ubuntu_check(osver:"8.04", pkgname:"libpostproc1d", pkgver:"0.cvs20070307-5ubuntu7.1")) flag++;
    if (ubuntu_check(osver:"8.04", pkgname:"libswscale-dev", pkgver:"0.cvs20070307-5ubuntu7.1")) flag++;
    if (ubuntu_check(osver:"8.04", pkgname:"libswscale1d", pkgver:"0.cvs20070307-5ubuntu7.1")) flag++;
    
    if (flag)
    {
      security_report_v4(
        port       : 0,
        severity   : SECURITY_HOLE,
        extra      : ubuntu_report_get()
      );
      exit(0);
    }
    else
    {
      tested = ubuntu_pkg_tests_get();
      if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested);
      else audit(AUDIT_PACKAGE_NOT_INSTALLED, "ffmpeg / libavcodec-dev / libavcodec1d / libavformat-dev / etc");
    }
    
  • NASL familyFreeBSD Local Security Checks
    NASL idFREEBSD_PKG_5CCB1C14E35711DDA7650030843D3802.NASL
    descriptionSecunia reports : The vulnerability is caused due to a boundary error within the
    last seen2020-06-01
    modified2020-06-02
    plugin id35401
    published2009-01-16
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/35401
    titleFreeBSD : mplayer -- vulnerability in STR files processor (5ccb1c14-e357-11dd-a765-0030843d3802)
  • NASL familyMandriva Local Security Checks
    NASL idMANDRIVA_MDVSA-2008-157.NASL
    descriptionA vulnerability was found in how ffmpeg handled STR file demuxing. If a user were tricked into processing a malicious STR file, a remote attacker could execute arbitrary code with user privileges via applications linked against ffmpeg (CVE-2008-3162). The updated packages have been patched to correct this issue.
    last seen2020-06-01
    modified2020-06-02
    plugin id36794
    published2009-04-23
    reporterThis script is Copyright (C) 2009-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/36794
    titleMandriva Linux Security Advisory : ffmpeg (MDVSA-2008:157)
  • NASL familyGentoo Local Security Checks
    NASL idGENTOO_GLSA-200903-33.NASL
    descriptionThe remote host is affected by the vulnerability described in GLSA-200903-33 (FFmpeg: Multiple vulnerabilities) Multiple vulnerabilities were found in FFmpeg: astrange reported a stack-based buffer overflow in the str_read_packet() in libavformat/psxstr.c when processing .str files (CVE-2008-3162). Multiple buffer overflows in libavformat/utils.c (CVE-2008-4866). A buffer overflow in libavcodec/dca.c (CVE-2008-4867). An unspecified vulnerability in the avcodec_close() function in libavcodec/utils.c (CVE-2008-4868). Unspecified memory leaks (CVE-2008-4869). Tobias Klein repoerted a NULL pointer dereference due to an integer signedness error in the fourxm_read_header() function in libavformat/4xm.c (CVE-2009-0385). Impact : A remote attacker could entice a user to open a specially crafted media file, possibly leading to the execution of arbitrary code with the privileges of the user running the application, or a Denial of Service. Workaround : There is no known workaround at this time.
    last seen2020-06-01
    modified2020-06-02
    plugin id35969
    published2009-03-20
    reporterThis script is Copyright (C) 2009-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/35969
    titleGLSA-200903-33 : FFmpeg: Multiple vulnerabilities
  • NASL familyGentoo Local Security Checks
    NASL idGENTOO_GLSA-200901-07.NASL
    descriptionThe remote host is affected by the vulnerability described in GLSA-200901-07 (MPlayer: Multiple vulnerabilities) Multiple vulnerabilities have been reported in MPlayer: A stack-based buffer overflow was found in the str_read_packet() function in libavformat/psxstr.c when processing crafted STR files that interleave audio and video sectors (CVE-2008-3162). Felipe Andres Manzano reported multiple integer underflows in the demux_real_fill_buffer() function in demux_real.c when processing crafted Real Media files that cause the stream_read() function to read or write arbitrary memory (CVE-2008-3827). Tobias Klein reported a stack-based buffer overflow in the demux_open_vqf() function in libmpdemux/demux_vqf.c when processing malformed TwinVQ files (CVE-2008-5616). Impact : A remote attacker could entice a user to open a specially crafted STR, Real Media, or TwinVQ file to execute arbitrary code or cause a Denial of Service. Workaround : There is no known workaround at this time.
    last seen2020-06-01
    modified2020-06-02
    plugin id35355
    published2009-01-13
    reporterThis script is Copyright (C) 2009-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/35355
    titleGLSA-200901-07 : MPlayer: Multiple vulnerabilities
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-1781.NASL
    descriptionSeveral vulnerabilities have been discovered in ffmpeg, a multimedia player, server and encoder. The Common Vulnerabilities and Exposures project identifies the following problems : - CVE-2009-0385 It was discovered that watching a malformed 4X movie file could lead to the execution of arbitrary code. - CVE-2008-3162 It was discovered that using a crafted STR file can lead to the execution of arbitrary code.
    last seen2020-06-01
    modified2020-06-02
    plugin id38640
    published2009-04-30
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/38640
    titleDebian DSA-1781-1 : ffmpeg-debian - several vulnerabilities