Vulnerabilities > CVE-2009-1176 - Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerability in multiple products
Attack vector
UNKNOWN Attack complexity
UNKNOWN Privileges required
UNKNOWN Confidentiality impact
UNKNOWN Integrity impact
UNKNOWN Availability impact
UNKNOWN Summary
mapserv.c in mapserv in MapServer 4.x before 4.10.4 and 5.x before 5.2.2 does not ensure that the string holding the id parameter ends in a '\0' character, which allows remote attackers to conduct buffer-overflow attacks or have unspecified other impact via a long id parameter in a query action.
Vulnerable Configurations
Part | Description | Count |
---|---|---|
Application | 3 | |
Application | 39 |
Common Weakness Enumeration (CWE)
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.
Nessus
NASL family Fedora Local Security Checks NASL id FEDORA_2009-3383.NASL description The releases contain fixes for issues discovered in an audit of the CGI by a 3rd party (tickets #2939, #2941, #2942, #2943 and #2944). The issues are detailed at: http://trac.osgeo.org/mapserver/ticket/2939 http://trac.osgeo.org/mapserver/ticket/2941 http://trac.osgeo.org/mapserver/ticket/2942 http://trac.osgeo.org/mapserver/ticket/2943 http://trac.osgeo.org/mapserver/ticket/2944 Also provided is support for RFC-56 that addresses tightening up the control of access to mapfiles and templates: http://mapserver.org/development/rfc/ms-rfc-56.html Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-01 modified 2020-06-02 plugin id 36091 published 2009-04-07 reporter This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/36091 title Fedora 9 : mapserver-5.2.2-1.fc9 (2009-3383) code #%NASL_MIN_LEVEL 80502 # # (C) Tenable Network Security, Inc. # # The descriptive text and package checks in this plugin were # extracted from Fedora Security Advisory 2009-3383. # include("compat.inc"); if (description) { script_id(36091); script_version ("1.15"); script_cvs_date("Date: 2019/08/02 13:32:29"); script_cve_id("CVE-2009-0839", "CVE-2009-0840", "CVE-2009-0841", "CVE-2009-0842", "CVE-2009-0843", "CVE-2009-1176", "CVE-2009-1177"); script_xref(name:"FEDORA", value:"2009-3383"); script_name(english:"Fedora 9 : mapserver-5.2.2-1.fc9 (2009-3383)"); script_summary(english:"Checks rpm output for the updated package."); script_set_attribute( attribute:"synopsis", value:"The remote Fedora host is missing a security update." ); script_set_attribute( attribute:"description", value: "The releases contain fixes for issues discovered in an audit of the CGI by a 3rd party (tickets #2939, #2941, #2942, #2943 and #2944). The issues are detailed at: http://trac.osgeo.org/mapserver/ticket/2939 http://trac.osgeo.org/mapserver/ticket/2941 http://trac.osgeo.org/mapserver/ticket/2942 http://trac.osgeo.org/mapserver/ticket/2943 http://trac.osgeo.org/mapserver/ticket/2944 Also provided is support for RFC-56 that addresses tightening up the control of access to mapfiles and templates: http://mapserver.org/development/rfc/ms-rfc-56.html Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues." ); # http://mapserver.org/development/rfc/ms-rfc-56.html script_set_attribute( attribute:"see_also", value:"https://mapserver.org/development/rfc/ms-rfc-56.html" ); script_set_attribute( attribute:"see_also", value:"http://trac.osgeo.org/mapserver/ticket/2939" ); script_set_attribute( attribute:"see_also", value:"http://trac.osgeo.org/mapserver/ticket/2941" ); script_set_attribute( attribute:"see_also", value:"http://trac.osgeo.org/mapserver/ticket/2942" ); script_set_attribute( attribute:"see_also", value:"http://trac.osgeo.org/mapserver/ticket/2943" ); script_set_attribute( attribute:"see_also", value:"http://trac.osgeo.org/mapserver/ticket/2944" ); script_set_attribute( attribute:"see_also", value:"https://bugzilla.redhat.com/show_bug.cgi?id=493364" ); # https://lists.fedoraproject.org/pipermail/package-announce/2009-April/022116.html script_set_attribute( attribute:"see_also", value:"http://www.nessus.org/u?51c45a57" ); script_set_attribute( attribute:"solution", value:"Update the affected mapserver package." ); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C"); script_cwe_id(20, 22, 119, 200); script_set_attribute(attribute:"plugin_type", value:"local"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fedoraproject:fedora:mapserver"); script_set_attribute(attribute:"cpe", value:"cpe:/o:fedoraproject:fedora:9"); script_set_attribute(attribute:"patch_publication_date", value:"2009/04/06"); script_set_attribute(attribute:"plugin_publication_date", value:"2009/04/07"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_copyright(english:"This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof."); script_family(english:"Fedora Local Security Checks"); script_dependencies("ssh_get_info.nasl"); script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/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); release = get_kb_item("Host/RedHat/release"); if (isnull(release) || "Fedora" >!< release) audit(AUDIT_OS_NOT, "Fedora"); os_ver = eregmatch(pattern: "Fedora.*release ([0-9]+)", string:release); if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Fedora"); os_ver = os_ver[1]; if (! ereg(pattern:"^9([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Fedora 9.x", "Fedora " + os_ver); if (!get_kb_item("Host/RedHat/rpm-list")) 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, "Fedora", cpu); flag = 0; if (rpm_check(release:"FC9", reference:"mapserver-5.2.2-1.fc9")) flag++; if (flag) { if (report_verbosity > 0) security_hole(port:0, extra:rpm_report_get()); else security_hole(0); exit(0); } else { tested = pkg_tests_get(); if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested); else audit(AUDIT_PACKAGE_NOT_INSTALLED, "mapserver"); }
NASL family Fedora Local Security Checks NASL id FEDORA_2009-3357.NASL description The releases contain fixes for issues discovered in an audit of the CGI by a 3rd party (tickets #2939, #2941, #2942, #2943 and #2944). The issues are detailed at: http://trac.osgeo.org/mapserver/ticket/2939 http://trac.osgeo.org/mapserver/ticket/2941 http://trac.osgeo.org/mapserver/ticket/2942 http://trac.osgeo.org/mapserver/ticket/2943 http://trac.osgeo.org/mapserver/ticket/2944 Also provided is support for RFC-56 that addresses tightening up the control of access to mapfiles and templates: http://mapserver.org/development/rfc/ms-rfc-56.html Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-01 modified 2020-06-02 plugin id 37298 published 2009-04-23 reporter This script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/37298 title Fedora 10 : mapserver-5.2.2-1.fc10 (2009-3357) code #%NASL_MIN_LEVEL 80502 # # (C) Tenable Network Security, Inc. # # The descriptive text and package checks in this plugin were # extracted from Fedora Security Advisory 2009-3357. # include("compat.inc"); if (description) { script_id(37298); script_version ("1.14"); script_cvs_date("Date: 2019/08/02 13:32:29"); script_cve_id("CVE-2009-0839", "CVE-2009-0840", "CVE-2009-0841", "CVE-2009-0842", "CVE-2009-0843", "CVE-2009-1176", "CVE-2009-1177"); script_xref(name:"FEDORA", value:"2009-3357"); script_name(english:"Fedora 10 : mapserver-5.2.2-1.fc10 (2009-3357)"); script_summary(english:"Checks rpm output for the updated package."); script_set_attribute( attribute:"synopsis", value:"The remote Fedora host is missing a security update." ); script_set_attribute( attribute:"description", value: "The releases contain fixes for issues discovered in an audit of the CGI by a 3rd party (tickets #2939, #2941, #2942, #2943 and #2944). The issues are detailed at: http://trac.osgeo.org/mapserver/ticket/2939 http://trac.osgeo.org/mapserver/ticket/2941 http://trac.osgeo.org/mapserver/ticket/2942 http://trac.osgeo.org/mapserver/ticket/2943 http://trac.osgeo.org/mapserver/ticket/2944 Also provided is support for RFC-56 that addresses tightening up the control of access to mapfiles and templates: http://mapserver.org/development/rfc/ms-rfc-56.html Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues." ); # http://mapserver.org/development/rfc/ms-rfc-56.html script_set_attribute( attribute:"see_also", value:"https://mapserver.org/development/rfc/ms-rfc-56.html" ); script_set_attribute( attribute:"see_also", value:"http://trac.osgeo.org/mapserver/ticket/2939" ); script_set_attribute( attribute:"see_also", value:"http://trac.osgeo.org/mapserver/ticket/2941" ); script_set_attribute( attribute:"see_also", value:"http://trac.osgeo.org/mapserver/ticket/2942" ); script_set_attribute( attribute:"see_also", value:"http://trac.osgeo.org/mapserver/ticket/2943" ); script_set_attribute( attribute:"see_also", value:"http://trac.osgeo.org/mapserver/ticket/2944" ); script_set_attribute( attribute:"see_also", value:"https://bugzilla.redhat.com/show_bug.cgi?id=493364" ); # https://lists.fedoraproject.org/pipermail/package-announce/2009-April/022093.html script_set_attribute( attribute:"see_also", value:"http://www.nessus.org/u?7a686300" ); script_set_attribute( attribute:"solution", value:"Update the affected mapserver package." ); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:C/I:C/A:C"); script_cwe_id(20, 22, 119, 200); script_set_attribute(attribute:"plugin_type", value:"local"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:fedoraproject:fedora:mapserver"); script_set_attribute(attribute:"cpe", value:"cpe:/o:fedoraproject:fedora:10"); script_set_attribute(attribute:"patch_publication_date", value:"2009/04/06"); 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 and is owned by Tenable, Inc. or an Affiliate thereof."); script_family(english:"Fedora Local Security Checks"); script_dependencies("ssh_get_info.nasl"); script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/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); release = get_kb_item("Host/RedHat/release"); if (isnull(release) || "Fedora" >!< release) audit(AUDIT_OS_NOT, "Fedora"); os_ver = eregmatch(pattern: "Fedora.*release ([0-9]+)", string:release); if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Fedora"); os_ver = os_ver[1]; if (! ereg(pattern:"^10([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Fedora 10.x", "Fedora " + os_ver); if (!get_kb_item("Host/RedHat/rpm-list")) 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, "Fedora", cpu); flag = 0; if (rpm_check(release:"FC10", reference:"mapserver-5.2.2-1.fc10")) flag++; if (flag) { if (report_verbosity > 0) security_hole(port:0, extra:rpm_report_get()); else security_hole(0); exit(0); } else { tested = pkg_tests_get(); if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested); else audit(AUDIT_PACKAGE_NOT_INSTALLED, "mapserver"); }
NASL family CGI abuses NASL id MAPSERVER_5_2_2.NASL description The remote host is running MapServer, an open source Internet map server. The installed version of MapServer is affected by multiple flaws : - By creating a map file with overly long IMAGEPATH and/or NAME attribute(s), it may be possible to trigger a stack-based buffer overflow. (CVE-2009-0839) - It may be possible to trigger a heap-based buffer overflow by sending a HTTP POST request with last seen 2020-06-01 modified 2020-06-02 plugin id 36074 published 2009-04-02 reporter This script is Copyright (C) 2009-2018 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/36074 title MapServer < 5.2.2 / 4.10.4 Multiple Flaws code # # (C) Tenable Network Security, Inc. # include("compat.inc"); if (description) { script_id(36074); script_version("1.15"); script_cvs_date("Date: 2018/11/15 20:50:17"); script_cve_id("CVE-2009-0839", "CVE-2009-0840", "CVE-2009-0841", "CVE-2009-0842", "CVE-2009-0843", "CVE-2009-1176", "CVE-2009-1177"); script_bugtraq_id(34306); script_xref(name:"Secunia", value:"34520"); script_name(english:"MapServer < 5.2.2 / 4.10.4 Multiple Flaws"); script_summary(english:"Performs a banner check"); script_set_attribute(attribute:"synopsis", value: "The remote web server contains a CGI script that is affected by multiple flaws."); script_set_attribute(attribute:"description", value: "The remote host is running MapServer, an open source Internet map server. The installed version of MapServer is affected by multiple flaws : - By creating a map file with overly long IMAGEPATH and/or NAME attribute(s), it may be possible to trigger a stack-based buffer overflow. (CVE-2009-0839) - It may be possible to trigger a heap-based buffer overflow by sending a HTTP POST request with 'CONTENT_LENGTH' attribute set to '-1'. (CVE-2009-0840) Note: According to some reports this issue might have been incorrectly fixed, see references for more info. - It may be possible to create arbitrary files by specifying file names to the 'id' parameter. (CVE-2009-0841) - Provided an attacker has privileges to create symlinks on the file system, it may be possible to partially read the contents of arbitrary files. (CVE-2009-0842) - Provided an attacker has knowledge of a valid map file, it may be possible to determine if an arbitrary file exists on the remote system. (CVE-2009-0843) - Sufficient boundary checks are not performed on 'id' parameter in mapserver.c. An attacker may exploit this issue to trigger a buffer overflow condition resulting in arbitrary code execution on the remote system. (CVE-2009-1176) - File maptemplate.c is affected by multiple stack-based overflow issues. (CVE-2009-1177)"); script_set_attribute(attribute:"see_also", value:"https://www.positronsecurity.com/advisories/2009-000.html"); script_set_attribute(attribute:"see_also", value:"http://permalink.gmane.org/gmane.comp.security.oss.general/1861"); script_set_attribute(attribute:"see_also", value:"https://seclists.org/fulldisclosure/2009/Mar/442"); script_set_attribute(attribute:"see_also", value:"https://lists.osgeo.org/pipermail/mapserver-users/2009-March/060600.html"); script_set_attribute(attribute:"solution", value:"Upgrade to MapServer 5.2.2/4.10.4."); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P"); script_set_cvss_temporal_vector("CVSS2#E:F/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(20, 22, 119, 200); script_set_attribute(attribute:"plugin_publication_date", value:"2009/04/02"); script_set_attribute(attribute:"potential_vulnerability", value:"true"); script_set_attribute(attribute:"plugin_type", value:"remote"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_family(english:"CGI abuses"); script_copyright(english:"This script is Copyright (C) 2009-2018 Tenable Network Security, Inc."); script_dependencies("mapserver_detect.nasl"); script_require_ports("Services/www", 80); script_require_keys("www/mapserver", "Settings/ParanoidReport"); exit(0); } include("audit.inc"); include("global_settings.inc"); include("http.inc"); include("misc_func.inc"); include("webapp_func.inc"); if (report_paranoia < 2) audit(AUDIT_PARANOID); app_name = "MapServer"; port = get_http_port(default:80); install = get_install_from_kb(appname:'mapserver', port:port, exit_on_fail:TRUE); version = install['ver']; url = build_url(port:port, qs:install['dir']); # Determine fixed version from branch. if (version =~ "^[0-4]($|[-\.])") fix = "4.10.4"; else if (version =~ "^5($|[-\.])") fix = "5.2.2"; else audit(AUDIT_WEB_APP_NOT_AFFECTED, app_name, url, version); if (ver_compare(app:'asterisk', ver:version, fix:fix) == -1 ) { if(report_verbosity > 0) { report = '\n URL : ' + url + '\n Version : ' + version + '\n Fixed version : ' + fix + '\n'; security_hole(port:port,extra:report); } else security_hole(port); exit(0); } else audit(AUDIT_WEB_APP_NOT_AFFECTED, app_name, url, version);
Seebug
bulletinFamily | exploit |
description | BUGTRAQ ID: 34306 CVE(CAN) ID: CVE-2009-0839,CVE-2009-0840,CVE-2009-0841,CVE-2009-0843,CVE-2009-0842,CVE-2009-1176,CVE-2009-1177 MapServer是用于创建交互式地图应用的多平台程序。 MapServer中存在多个安全漏洞,可能允许远程攻击者泄露敏感信息、绕过安全限制、导致拒绝服务或入侵有漏洞的系统。 1) 如果远程攻击者向服务器上传了恶意地图文件或通过id参数传送了包含有超过128字节字符串的特制请求的话,就可以在mapserv CGI程序中触发栈溢出,导致执行任意代码。以下是mapserv.c中有漏洞的代码段: 406: strncpy(mapserv->Id, mapserv->request->ParamValues[i], IDSIZE); 1112: int main(int argc, char *argv[]) { 1114: char buffer[1024], *value=NULL; 1783: sprintf(buffer, \"%s%s%s%s\", mapserv->map->web.imagepath, \\ mapserv->map->name, mapserv->Id, MS_QUERY_EXTENSION); 1826: } 2) mapserv CGI程序在处理Content-Length头时存在索引错误,远程攻击者可以通过提交特制的POST请求触发堆溢出,导致越界数组访问。成功攻击要求web服务器没有过滤Content-Length头。 3) 由于没有过滤对mapserv CGI程序所传送的id参数,远程攻击者可以通过目录遍历攻击向任意位置写入文件。以下是有漏洞部分的代码段: [mapserv.c] 1783: sprintf(buffer, \"%s%s%s%s\", mapserv->map->web.imagepath, \\ mapserv->map->name, mapserv->Id, MS_QUERY_EXTENSION); 1784: if((status = msSaveQuery(mapserv->map, buffer)) != MS_SUCCESS) \\ return status; [mapquery.c] 89: stream = fopen(filename, \"wb\"); 90: if(!stream) { 91: [...] 92: return(MS_FAILURE); 93: } 4) 如果攻击者在.map文件中通过map参数指定了完整路径,则mapserv CGI程序在处理该文件时就会泄露文件中的敏感信息。 5) mapserv CGI程序对系统中是否存在的文件会返回不同的错误消息,远程攻击者可以利用queryfile请求参数判断是否存在特定的文件。 6) 特制的地图文件可以在maptemplate.c的msGenerateImages()函数中触发栈溢出。 University of Minnesota MapServer 5.2.1 University of Minnesota MapServer 4.10.3 University of Minnesota ----------------------- 目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载: <a href=http://download.osgeo.org/mapserver/mapserver-4.10.4.tar.gz target=_blank rel=external nofollow>http://download.osgeo.org/mapserver/mapserver-4.10.4.tar.gz</a> <a href=http://download.osgeo.org/mapserver/mapserver-5.2.2.tar.gz target=_blank rel=external nofollow>http://download.osgeo.org/mapserver/mapserver-5.2.2.tar.gz</a> |
id | SSV:4975 |
last seen | 2017-11-19 |
modified | 2009-04-02 |
published | 2009-04-02 |
reporter | Root |
source | https://www.seebug.org/vuldb/ssvid-4975 |
title | MapServer mapserv程序多个远程安全漏洞 |
References
- http://lists.osgeo.org/pipermail/mapserver-users/2009-March/060600.html
- http://lists.osgeo.org/pipermail/mapserver-users/2009-March/060600.html
- http://secunia.com/advisories/34603
- http://secunia.com/advisories/34603
- http://www.positronsecurity.com/advisories/2009-000.html
- http://www.positronsecurity.com/advisories/2009-000.html
- http://www.securityfocus.com/archive/1/502271/100/0/threaded
- http://www.securityfocus.com/archive/1/502271/100/0/threaded
- http://www.securityfocus.com/bid/34306
- http://www.securityfocus.com/bid/34306
- http://www.securitytracker.com/id?1021952
- http://www.securitytracker.com/id?1021952
- https://www.redhat.com/archives/fedora-package-announce/2009-April/msg00147.html
- https://www.redhat.com/archives/fedora-package-announce/2009-April/msg00147.html
- https://www.redhat.com/archives/fedora-package-announce/2009-April/msg00170.html
- https://www.redhat.com/archives/fedora-package-announce/2009-April/msg00170.html