Vulnerabilities > CVE-2007-1649 - Unspecified vulnerability in PHP 5.2.1

047910
CVSS 7.8 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
COMPLETE
Integrity impact
NONE
Availability impact
NONE
network
low complexity
php
nessus
exploit available

Summary

PHP 5.2.1 allows context-dependent attackers to read portions of heap memory by executing certain scripts with a serialized data input string beginning with S:, which does not properly track the number of input bytes being processed.

Vulnerable Configurations

Part Description Count
Application
Php
1

Exploit-Db

descriptionPHP 5.2.1 unserialize() Local Information Leak Exploit. CVE-2007-1649. Local exploits for multiple platform
idEDB-ID:3559
last seen2016-01-31
modified2007-03-23
published2007-03-23
reporterStefan Esser
sourcehttps://www.exploit-db.com/download/3559/
titlePHP 5.2.1 unserialize Local Information Leak Exploit

Nessus

  • NASL familyCGI abuses
    NASL idPHP_5_2_2.NASL
    descriptionAccording to its banner, the version of PHP 5.x installed on the remote host is older than 5.2.2. It is, therefore, affected by multiple vulnerabilities: - A heap-based buffer overflow vulnerability was found in PHP
    last seen2020-06-01
    modified2020-06-02
    plugin id17797
    published2012-01-11
    reporterThis script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/17797
    titlePHP 5.x < 5.2.2 Multiple vulnerabilities
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(17797);
      script_version("1.7");
      script_cvs_date("Date: 2019/03/27 13:17:50");
    
      script_cve_id(
        "CVE-2007-1001",
        "CVE-2007-1583",
        "CVE-2007-1649", 
        "CVE-2007-1717",
        "CVE-2007-1718"
    
        );
      script_bugtraq_id(23105, 23357);
    
      script_name(english:"PHP 5.x < 5.2.2 Multiple vulnerabilities");
      script_summary(english:"Checks version of PHP");
     
      script_set_attribute(
        attribute:"synopsis",
        value:
    "The remote web server uses a version of PHP that is affected by
    multiple vulnerabilities."
      );
      script_set_attribute(
        attribute:"description",
        value:
    "According to its banner, the version of PHP 5.x installed on the
    remote host is older than 5.2.2.  It is, therefore, affected by 
    multiple vulnerabilities:
    
      - A heap-based buffer overflow vulnerability was found
        in PHP's gd extension. A script that could be forced to
        process WBMP images from an untrusted source could
        result in arbitrary code execution. (CVE-2007-1001)
    
      - A vulnerability in the way the mbstring extension
        setglobal variables was discovered where a script using
        the mb_parse_str() function to set global variables
        could be forced to to enable the register_globals
        configuration option, possibly resulting in global
        variable injection. (CVE-2007-1583)
    
      - A context-dependent attacker could read portions of
        heap memory by executing certain scripts with a
        serialized data input string beginning with 'S:', which
        did not properly track the number of input bytes being
        processed. (CVE-2007-1649)
    
      - A vulnerability in how PHP's mail() function processed
        email messages, truncating potentially important 
        information after the first ASCIIZ (\0) byte.
        (CVE-2007-1717)
    
      - A vulnerability in how PHP's mail() function processed
        header data was discovered. If a script sent mail using
        a subject header containing a string from an untrusted
        source, a remote attacker could send bulk email to
        unintended recipients (CVE-2007-1718)."
    
      );
      script_set_attribute(attribute:"see_also", value:"http://www.php.net/releases/5_2_2.php");
      script_set_attribute(attribute:"solution", value:"Upgrade to PHP version 5.2.2 or later.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:N/A:N");
      script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:P/RL:O/RC:C");
      script_set_attribute(attribute:"cvss_score_source", value:"CVE-2007-1649");
      script_set_attribute(attribute:"exploitability_ease", value:"No exploit is required");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2007/03/23");
      script_set_attribute(attribute:"patch_publication_date", value:"2007/05/03");
      script_set_attribute(attribute:"plugin_publication_date", value:"2012/01/11");
    
      script_set_attribute(attribute:"plugin_type", value:"remote");
      script_set_attribute(attribute:"cpe", value:"cpe:/a:php:php");
      script_end_attributes();
     
      script_category(ACT_GATHER_INFO);
      script_family(english:"CGI abuses");
    
      script_copyright(english:"This script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
    
      script_dependencies("php_version.nasl");
      script_require_ports("Services/www", 80);
      script_require_keys("www/PHP");
      exit(0);
    }
    
    
    include("global_settings.inc");
    include("misc_func.inc");
    include("http.inc");
    include("audit.inc");
    include("webapp_func.inc");
    
    port = get_http_port(default:80, php:TRUE);
    
    php = get_php_from_kb(
      port : port,
      exit_on_fail : TRUE
    );
    
    version = php["ver"];
    source = php["src"];
    
    backported = get_kb_item('www/php/'+port+'/'+version+'/backported');
    
    if (report_paranoia < 2 && backported)
      audit(AUDIT_BACKPORT_SERVICE, port, "PHP "+version+" install");
    
    if (version !~ "^5\.") exit(0, "The web server on port "+port+" uses PHP "+version+" rather than 5.x.");
    
    if (version =~ "^5\.([01]\..*|2\.[01])($|[^0-9])")
    {
      if (report_verbosity > 0)
      {
        report =
          '\n  Version source     : '+source +
          '\n  Installed version  : '+version+
          '\n  Fixed version      : 5.2.2\n';
        security_hole(port:port, extra:report);
      }
      else security_hole(port);
      exit(0);
    }
    else audit(AUDIT_LISTEN_NOT_VULN, "PHP", port, version);
    
  • NASL familyMandriva Local Security Checks
    NASL idMANDRIVA_MDVSA-2008-126.NASL
    descriptionA number of vulnerabilities have been found and corrected in PHP : PHP 5.2.1 would allow context-dependent attackers to read portions of heap memory by executing certain scripts with a serialized data input string beginning with
    last seen2020-06-01
    modified2020-06-02
    plugin id37584
    published2009-04-23
    reporterThis script is Copyright (C) 2009-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/37584
    titleMandriva Linux Security Advisory : php (MDVSA-2008:126)
    code
    #%NASL_MIN_LEVEL 80502
    
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Mandriva Linux Security Advisory MDVSA-2008:126. 
    # The text itself is copyright (C) Mandriva S.A.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(37584);
      script_version ("1.21");
      script_cvs_date("Date: 2019/08/02 13:32:50");
    
      script_cve_id(
        "CVE-2007-1649",
        "CVE-2007-4660",
        "CVE-2007-5898",
        "CVE-2007-5899",
        "CVE-2008-2051",
        "CVE-2008-2107",
        "CVE-2008-2108",
        "CVE-2008-2829"
      );
      script_bugtraq_id(
        23105,
        25498,
        26403,
        29829
      );
      script_xref(name:"MDVSA", value:"2008:126");
    
      script_name(english:"Mandriva Linux Security Advisory : php (MDVSA-2008:126)");
      script_summary(english:"Checks rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:
    "The remote Mandriva Linux host is missing one or more security
    updates."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "A number of vulnerabilities have been found and corrected in PHP :
    
    PHP 5.2.1 would allow context-dependent attackers to read portions of
    heap memory by executing certain scripts with a serialized data input
    string beginning with 'S:', which did not properly track the number of
    input bytes being processed (CVE-2007-1649).
    
    A vulnerability in the chunk_split() function in PHP prior to 5.2.4
    has unknown impact and attack vectors, related to an incorrect size
    calculation (CVE-2007-4660).
    
    The htmlentities() and htmlspecialchars() functions in PHP prior to
    5.2.5 accepted partial multibyte sequences, which has unknown impact
    and attack vectors (CVE-2007-5898).
    
    The output_add_rewrite_var() function in PHP prior to 5.2.5 rewrites
    local forms in which the ACTION attribute references a non-local URL,
    which could allow a remote attacker to obtain potentially sensitive
    information by reading the requests for this URL (CVE-2007-5899).
    
    The escapeshellcmd() API function in PHP prior to 5.2.6 has unknown
    impact and context-dependent attack vectors related to incomplete
    multibyte characters (CVE-2008-2051).
    
    Weaknesses in the GENERATE_SEED macro in PHP prior to 4.4.8 and 5.2.5
    were discovered that could produce a zero seed in rare circumstances
    on 32bit systems and generations a portion of zero bits during
    conversion due to insufficient precision on 64bit systems
    (CVE-2008-2107, CVE-2008-2108).
    
    The IMAP module in PHP uses obsolete API calls that allow
    context-dependent attackers to cause a denial of service (crash) via a
    long IMAP request (CVE-2008-2829).
    
    The updated packages have been patched to correct these issues."
      );
      script_set_attribute(attribute:"solution", value:"Update the affected packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C");
      script_set_cvss_temporal_vector("CVSS2#E:POC/RL:OF/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"Exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"true");
      script_cwe_id(119, 189, 200, 399);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:lib64php5_common5");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:libphp5_common5");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-cgi");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-cli");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-devel");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-fcgi");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-imap");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-openssl");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:mandriva:linux:php-zlib");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:mandriva:linux:2007.1");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2008/07/03");
      script_set_attribute(attribute:"plugin_publication_date", value:"2009/04/23");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2009-2019 Tenable Network Security, Inc.");
      script_family(english:"Mandriva Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/Mandrake/release", "Host/Mandrake/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/Mandrake/release")) audit(AUDIT_OS_NOT, "Mandriva / Mandake Linux");
    if (!get_kb_item("Host/Mandrake/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if (cpu !~ "^(amd64|i[3-6]86|x86_64)$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Mandriva / Mandrake Linux", cpu);
    
    
    flag = 0;
    if (rpm_check(release:"MDK2007.1", cpu:"x86_64", reference:"lib64php5_common5-5.2.1-4.4mdv2007.1", yank:"mdv")) flag++;
    if (rpm_check(release:"MDK2007.1", cpu:"i386", reference:"libphp5_common5-5.2.1-4.4mdv2007.1", yank:"mdv")) flag++;
    if (rpm_check(release:"MDK2007.1", reference:"php-cgi-5.2.1-4.4mdv2007.1", yank:"mdv")) flag++;
    if (rpm_check(release:"MDK2007.1", reference:"php-cli-5.2.1-4.4mdv2007.1", yank:"mdv")) flag++;
    if (rpm_check(release:"MDK2007.1", reference:"php-devel-5.2.1-4.4mdv2007.1", yank:"mdv")) flag++;
    if (rpm_check(release:"MDK2007.1", reference:"php-fcgi-5.2.1-4.4mdv2007.1", yank:"mdv")) flag++;
    if (rpm_check(release:"MDK2007.1", reference:"php-imap-5.2.1-1.1mdv2007.1", yank:"mdv")) flag++;
    if (rpm_check(release:"MDK2007.1", reference:"php-openssl-5.2.1-4.4mdv2007.1", yank:"mdv")) flag++;
    if (rpm_check(release:"MDK2007.1", reference:"php-zlib-5.2.1-4.4mdv2007.1", yank:"mdv")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_hole(port:0, extra:rpm_report_get());
      else security_hole(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    

Statements

contributorMark J Cox
lastmodified2007-04-16
organizationRed Hat
statementNot vulnerable. These issues did not affect the versions of PHP as shipped with Red Hat Enterprise Linux 2.1, 3, 4, 5, Stronghold 4.0, or Red Hat Application Stack 1.