Vulnerabilities > CVE-2012-6619 - Improper Input Validation vulnerability in Mongodb
Attack vector
NETWORK Attack complexity
LOW Privileges required
NONE Confidentiality impact
PARTIAL Integrity impact
NONE Availability impact
PARTIAL Summary
The default configuration for MongoDB before 2.3.2 does not validate objects, which allows remote authenticated users to cause a denial of service (crash) or read system memory via a crafted BSON object in the column name in an insert command, which triggers a buffer over-read.
Vulnerable Configurations
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.
- Server Side Include (SSI) Injection An attacker can use Server Side Include (SSI) Injection to send code to a web application that then gets executed by the web server. Doing so enables the attacker to achieve similar results to Cross Site Scripting, viz., arbitrary code execution and information disclosure, albeit on a more limited scale, since the SSI directives are nowhere near as powerful as a full-fledged scripting language. Nonetheless, the attacker can conveniently gain access to sensitive files, such as password files, and execute shell commands.
- Cross Zone Scripting An attacker is able to cause a victim to load content into their web-browser that bypasses security zone controls and gain access to increased privileges to execute scripting code or other web objects such as unsigned ActiveX controls or applets. This is a privilege elevation attack targeted at zone-based web-browser security. In a zone-based model, pages belong to one of a set of zones corresponding to the level of privilege assigned to that page. Pages in an untrusted zone would have a lesser level of access to the system and/or be restricted in the types of executable content it was allowed to invoke. In a cross-zone scripting attack, a page that should be assigned to a less privileged zone is granted the privileges of a more trusted zone. This can be accomplished by exploiting bugs in the browser, exploiting incorrect configuration in the zone controls, through a cross-site scripting attack that causes the attackers' content to be treated as coming from a more trusted page, or by leveraging some piece of system functionality that is accessible from both the trusted and less trusted zone. This attack differs from "Restful Privilege Escalation" in that the latter correlates to the inadequate securing of RESTful access methods (such as HTTP DELETE) on the server, while cross-zone scripting attacks the concept of security zones as implemented by a browser.
- Cross Site Scripting through Log Files An attacker may leverage a system weakness where logs are susceptible to log injection to insert scripts into the system's logs. If these logs are later viewed by an administrator through a thin administrative interface and the log data is not properly HTML encoded before being written to the page, the attackers' scripts stored in the log will be executed in the administrative interface with potentially serious consequences. This attack pattern is really a combination of two other attack patterns: log injection and stored cross site scripting.
- Command Line Execution through SQL Injection An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.
Nessus
NASL family Databases NASL id MONGODB_2_3_2.NASL description The version of the remote MongoDB server is a version prior to 2.3.2. It is, therefore, potentially affected by an information disclosure vulnerability. An error exists related to handling BSON (Binary JavaScript Object Notation) objects having incorrect length that could allow possible disclosure of information held in memory. last seen 2020-06-01 modified 2020-06-02 plugin id 72334 published 2014-02-05 reporter This script is Copyright (C) 2014-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/72334 title MongoDB < 2.3.2 BSON Object Length Handling Memory Disclosure code # # (C) Tenable Network Security, Inc. # include("compat.inc"); if (description) { script_id(72334); script_version("1.7"); script_cvs_date("Date: 2019/11/26"); script_cve_id("CVE-2012-6619"); script_bugtraq_id(64687); script_name(english:"MongoDB < 2.3.2 BSON Object Length Handling Memory Disclosure"); script_summary(english:"Checks version of MongoDB"); script_set_attribute(attribute:"synopsis", value: "The remote database server is affected by an information disclosure vulnerability."); script_set_attribute(attribute:"description", value: "The version of the remote MongoDB server is a version prior to 2.3.2. It is, therefore, potentially affected by an information disclosure vulnerability. An error exists related to handling BSON (Binary JavaScript Object Notation) objects having incorrect length that could allow possible disclosure of information held in memory."); script_set_attribute(attribute:"see_also", value:"https://www.mongodb.com/alerts#security-related"); # https://groups.google.com/forum/#!searchin/mongodb-announce/SERVER-7769/mongodb-announce/3SkNJdemy84/ovLd_TclNh4J script_set_attribute(attribute:"see_also", value:"http://www.nessus.org/u?4cbacf08"); script_set_attribute(attribute:"see_also", value:"https://jira.mongodb.org/browse/SERVER-7769"); script_set_attribute(attribute:"see_also", value:"http://article.gmane.org/gmane.comp.security.oss.general/11822"); script_set_attribute(attribute:"see_also", value:"http://blog.ptsecurity.com/2012/11/attacking-mongodb_26.html"); script_set_attribute(attribute:"solution", value: "Upgrade to MongoDB 2.3.2 / 2.4.0 or later. Alternatively, use the '--objcheck' command line switch to force object checking. Note that version 2.3.2 is a development version and is not recommended for production use."); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:P"); script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C"); script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"); script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C"); script_set_attribute(attribute:"cvss_score_source", value:"CVE-2012-6619"); script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available"); script_set_attribute(attribute:"exploit_available", value:"false"); script_set_attribute(attribute:"vuln_publication_date", value:"2012/11/26"); script_set_attribute(attribute:"patch_publication_date", value:"2012/11/27"); script_set_attribute(attribute:"plugin_publication_date", value:"2014/02/05"); script_set_attribute(attribute:"potential_vulnerability", value:"true"); script_set_attribute(attribute:"plugin_type", value:"remote"); script_set_attribute(attribute:"cpe", value:"cpe:/a:mongodb:mongodb"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_family(english:"Databases"); script_copyright(english:"This script is Copyright (C) 2014-2019 and is owned by Tenable, Inc. or an Affiliate thereof."); script_dependencies("mongodb_detect.nasl"); script_require_keys("Services/mongodb", "Settings/ParanoidReport"); exit(0); } include("audit.inc"); include("global_settings.inc"); include("misc_func.inc"); appname = "MongoDB"; port = get_service(svc:"mongodb", exit_on_fail:TRUE); version = get_kb_item_or_exit("mongodb/" + port + "/Version"); databases = get_kb_list('mongodb/' + port + '/Databases'); if (report_paranoia < 2) audit(AUDIT_PARANOID); fix = '2.3.2'; # Affected : < 2.3.2 if (ver_compare(ver:version, fix:fix, strict:FALSE) < 0) { if (report_verbosity > 0) { report = '\n Installed version : ' + version + '\n Fixed version : ' + fix + ' / 2.4.0'; if(databases) report += '\n Databases : '; first = TRUE; foreach database (databases) { if(!first) report += ' '; report += database; collections = get_kb_item('mongodb/' + port + '/Collections/' + database); if(collections) report += ' - ' + collections; report += '\n'; first = FALSE; } report += '\n'; security_warning(port:port, extra:report); } else security_warning(port); exit(0); } else audit(AUDIT_INST_VER_NOT_VULN, appname, version);
NASL family Red Hat Local Security Checks NASL id REDHAT-RHSA-2014-0440.NASL description Updated Grid component packages that fix two security issues, multiple bugs, and provide several enhancements are now available for Red Hat Enterprise MRG 2.5 for Red Hat Enterprise Linux 6. The Red Hat Security Response Team has rated this update as having Moderate security impact. Common Vulnerability Scoring System (CVSS) base scores, which give detailed severity ratings, are available for each vulnerability from the CVE links in the References section. Red Hat Enterprise MRG (Messaging, Realtime, and Grid) is a next-generation IT infrastructure for enterprise computing. MRG offers increased performance, reliability, interoperability, and faster computing for enterprise customers. MRG Grid provides high-throughput computing and enables enterprises to achieve higher peak computing capacity as well as improved infrastructure utilization by leveraging their existing technology to build high performance grids. MRG Grid provides a job-queueing mechanism, scheduling policy, and a priority scheme, as well as resource monitoring and resource management. Users submit their jobs to MRG Grid, where they are placed into a queue. MRG Grid then chooses when and where to run the jobs based upon a policy, carefully monitors their progress, and ultimately informs the user upon completion. A buffer over-read flaw was found in the way MongoDB handled BSON data. A database user permitted to insert BSON data into a MongoDB server could use this flaw to read server memory, potentially disclosing sensitive data. (CVE-2012-6619) Note: This update addresses CVE-2012-6619 by enabling the last seen 2020-06-01 modified 2020-06-02 plugin id 76675 published 2014-07-22 reporter This script is Copyright (C) 2014-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/76675 title RHEL 6 : MRG (RHSA-2014:0440) code # # (C) Tenable Network Security, Inc. # # The descriptive text and package checks in this plugin were # extracted from Red Hat Security Advisory RHSA-2014:0440. The text # itself is copyright (C) Red Hat, Inc. # include("compat.inc"); if (description) { script_id(76675); script_version("1.12"); script_cvs_date("Date: 2019/10/24 15:35:38"); script_cve_id("CVE-2012-6619", "CVE-2013-6445"); script_bugtraq_id(67733); script_xref(name:"RHSA", value:"2014:0440"); script_name(english:"RHEL 6 : MRG (RHSA-2014:0440)"); script_summary(english:"Checks the rpm output for the updated packages"); script_set_attribute( attribute:"synopsis", value:"The remote Red Hat host is missing one or more security updates." ); script_set_attribute( attribute:"description", value: "Updated Grid component packages that fix two security issues, multiple bugs, and provide several enhancements are now available for Red Hat Enterprise MRG 2.5 for Red Hat Enterprise Linux 6. The Red Hat Security Response Team has rated this update as having Moderate security impact. Common Vulnerability Scoring System (CVSS) base scores, which give detailed severity ratings, are available for each vulnerability from the CVE links in the References section. Red Hat Enterprise MRG (Messaging, Realtime, and Grid) is a next-generation IT infrastructure for enterprise computing. MRG offers increased performance, reliability, interoperability, and faster computing for enterprise customers. MRG Grid provides high-throughput computing and enables enterprises to achieve higher peak computing capacity as well as improved infrastructure utilization by leveraging their existing technology to build high performance grids. MRG Grid provides a job-queueing mechanism, scheduling policy, and a priority scheme, as well as resource monitoring and resource management. Users submit their jobs to MRG Grid, where they are placed into a queue. MRG Grid then chooses when and where to run the jobs based upon a policy, carefully monitors their progress, and ultimately informs the user upon completion. A buffer over-read flaw was found in the way MongoDB handled BSON data. A database user permitted to insert BSON data into a MongoDB server could use this flaw to read server memory, potentially disclosing sensitive data. (CVE-2012-6619) Note: This update addresses CVE-2012-6619 by enabling the '--objcheck' option in the /etc/mongodb.conf file. If you have edited this file, the updated version will be stored as /etc/mongodb.conf.rpmnew, and you will need to merge the changes into /etc/mongodb.conf manually. It was found that MRG Management Console (cumin) used the crypt(3) DES-based hash function to hash passwords. DES-based hashing has known weaknesses that allow an attacker to recover plain text passwords from hashes. An attacker able to compromise a cumin user database could potentially use this flaw to recover plain text passwords from the password hashes stored in that database. (CVE-2013-6445) Note: In deployments where user account information is stored in a database managed by cumin, it is recommended that users change their passwords after this update is applied. The CVE-2013-6445 issue was discovered by Tomas Novacik of the Red Hat MRG Quality Engineering team. These updated packages for Red Hat Enterprise Linux 6 also provide numerous bug fixes and enhancements for the Grid component of Red Hat Enterprise MRG. Space precludes documenting all of these changes in this advisory. Refer to the Red Hat Enterprise MRG 2 Technical Notes document, available shortly from the link in the References section, for information on these changes. All users of the Grid capabilities of Red Hat Enterprise MRG are advised to upgrade to these updated packages, which correct these issues and add these enhancements." ); # https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_MRG/2 script_set_attribute( attribute:"see_also", value:"http://www.nessus.org/u?687515f3" ); script_set_attribute( attribute:"see_also", value:"https://access.redhat.com/errata/RHSA-2014:0440" ); script_set_attribute( attribute:"see_also", value:"https://access.redhat.com/security/cve/cve-2012-6619" ); script_set_attribute( attribute:"see_also", value:"https://access.redhat.com/security/cve/cve-2013-6445" ); script_set_attribute(attribute:"solution", value:"Update the affected packages."); script_set_cvss_base_vector("CVSS2#AV:N/AC:L/Au:N/C:P/I:N/A:P"); script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C"); script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available"); script_set_attribute(attribute:"exploit_available", value:"false"); script_set_attribute(attribute:"plugin_type", value:"local"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:condor"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:condor-aviary"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:condor-classads"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:condor-cluster-resource-agent"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:condor-debuginfo"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:condor-deltacloud-gahp"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:condor-kbdd"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:condor-plumage"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:condor-qmf"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:condor-vm-gahp"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:cumin"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:mongodb"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:mongodb-debuginfo"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:mongodb-server"); script_set_attribute(attribute:"cpe", value:"p-cpe:/a:redhat:enterprise_linux:mrg-release"); script_set_attribute(attribute:"cpe", value:"cpe:/o:redhat:enterprise_linux:6"); script_set_attribute(attribute:"vuln_publication_date", value:"2014/03/06"); script_set_attribute(attribute:"patch_publication_date", value:"2014/04/28"); script_set_attribute(attribute:"plugin_publication_date", value:"2014/07/22"); script_set_attribute(attribute:"generated_plugin", value:"current"); script_end_attributes(); script_category(ACT_GATHER_INFO); script_copyright(english:"This script is Copyright (C) 2014-2019 and is owned by Tenable, Inc. or an Affiliate thereof."); script_family(english:"Red Hat Local Security Checks"); script_dependencies("ssh_get_info.nasl"); script_require_keys("Host/local_checks_enabled", "Host/RedHat/release", "Host/RedHat/rpm-list", "Host/cpu"); exit(0); } include("audit.inc"); include("global_settings.inc"); include("misc_func.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) || "Red Hat" >!< release) audit(AUDIT_OS_NOT, "Red Hat"); os_ver = pregmatch(pattern: "Red Hat Enterprise Linux.*release ([0-9]+(\.[0-9]+)?)", string:release); if (isnull(os_ver)) audit(AUDIT_UNKNOWN_APP_VER, "Red Hat"); os_ver = os_ver[1]; if (! preg(pattern:"^6([^0-9]|$)", string:os_ver)) audit(AUDIT_OS_NOT, "Red Hat 6.x", "Red Hat " + 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$" && "s390" >!< cpu) audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Red Hat", cpu); yum_updateinfo = get_kb_item("Host/RedHat/yum-updateinfo"); if (!empty_or_null(yum_updateinfo)) { rhsa = "RHSA-2014:0440"; yum_report = redhat_generate_yum_updateinfo_report(rhsa:rhsa); if (!empty_or_null(yum_report)) { security_report_v4( port : 0, severity : SECURITY_WARNING, extra : yum_report ); exit(0); } else { audit_message = "affected by Red Hat security advisory " + rhsa; audit(AUDIT_OS_NOT, audit_message); } } else { flag = 0; if (! (rpm_exists(release:"RHEL6", rpm:"mrg-release"))) audit(AUDIT_PACKAGE_NOT_INSTALLED, "MRG"); if (rpm_check(release:"RHEL6", cpu:"i686", reference:"condor-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"condor-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"i686", reference:"condor-aviary-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"condor-aviary-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"i686", reference:"condor-classads-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"condor-classads-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"i686", reference:"condor-cluster-resource-agent-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"condor-cluster-resource-agent-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"i686", reference:"condor-debuginfo-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"condor-debuginfo-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"condor-deltacloud-gahp-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"i686", reference:"condor-kbdd-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"condor-kbdd-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"i686", reference:"condor-plumage-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"condor-plumage-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"i686", reference:"condor-qmf-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"condor-qmf-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"condor-vm-gahp-7.8.10-0.1.el6")) flag++; if (rpm_check(release:"RHEL6", reference:"cumin-0.1.5797-1.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"i686", reference:"mongodb-1.6.4-7.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"mongodb-1.6.4-7.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"i686", reference:"mongodb-debuginfo-1.6.4-7.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"mongodb-debuginfo-1.6.4-7.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"i686", reference:"mongodb-server-1.6.4-7.el6")) flag++; if (rpm_check(release:"RHEL6", cpu:"x86_64", reference:"mongodb-server-1.6.4-7.el6")) flag++; if (rpm_check(release:"RHEL6", reference:"mrg-release-2.5.0-1.el6")) flag++; if (flag) { security_report_v4( port : 0, severity : SECURITY_WARNING, extra : rpm_report_get() + redhat_report_package_caveat() ); exit(0); } else { tested = pkg_tests_get(); if (tested) audit(AUDIT_PACKAGE_NOT_AFFECTED, tested); else audit(AUDIT_PACKAGE_NOT_INSTALLED, "condor / condor-aviary / condor-classads / etc"); } }
Redhat
advisories |
| ||||||||
rpms |
|
References
- http://blog.ptsecurity.com/2012/11/attacking-mongodb.html
- http://rhn.redhat.com/errata/RHSA-2014-0230.html
- http://rhn.redhat.com/errata/RHSA-2014-0440.html
- http://www.openwall.com/lists/oss-security/2014/01/07/13
- http://www.openwall.com/lists/oss-security/2014/01/07/2
- http://www.openwall.com/lists/oss-security/2014/01/08/9
- https://bugzilla.redhat.com/show_bug.cgi?id=1049748
- https://jira.mongodb.org/browse/SERVER-7769