ID CVE-2012-0805
Summary Multiple SQL injection vulnerabilities in SQLAlchemy before 0.7.0b4, as used in Keystone, allow remote attackers to execute arbitrary SQL commands via the (1) limit or (2) offset keyword to the select function, or unspecified vectors to the (3) select.limit or (4) select.offset function.
References
Vulnerable Configurations
  • SQLAlchemy 0.6.0
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.6.0
  • SQLAlchemy 0.6.0 beta1
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.6.0:beta1
  • SQLAlchemy 0.6.0 beta2
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.6.0:beta2
  • SQLAlchemy 0.6.0 beta3
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.6.0:beta3
  • SQLAlchemy 0.6.1
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.6.1
  • SQLAlchemy 0.6.2
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.6.2
  • SQLAlchemy 0.6.3
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.6.3
  • SQLAlchemy 0.6.4
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.6.4
  • SQLAlchemy 0.6.5
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.6.5
  • SQLAlchemy 0.6.6
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.6.6
  • SQLAlchemy 0.6.7
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.6.7
  • SQLAlchemy 0.7.0b1
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.7.0:b1
  • SQLAlchemy 0.7.0b2
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.7.0:b2
  • SQLAlchemy 0.7.0b3
    cpe:2.3:a:sqlalchemy:sqlalchemy:0.7.0:b3
CVSS
Base: 7.5 (as of 06-06-2012 - 09:56)
Impact:
Exploitability:
CWE CWE-89
CAPEC
  • 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.
  • Object Relational Mapping Injection
    An attacker leverages a weakness present in the database access layer code generated with an Object Relational Mapping (ORM) tool or a weakness in the way that a developer used a persistence framework to inject his or her own SQL commands to be executed against the underlying database. The attack here is similar to plain SQL injection, except that the application does not use JDBC to directly talk to the database, but instead it uses a data access layer generated by an ORM tool or framework (e.g. Hibernate). While most of the time code generated by an ORM tool contains safe access methods that are immune to SQL injection, sometimes either due to some weakness in the generated code or due to the fact that the developer failed to use the generated access methods properly, SQL injection is still possible.
  • SQL Injection through SOAP Parameter Tampering
    An attacker modifies the parameters of the SOAP message that is sent from the service consumer to the service provider to initiate a SQL injection attack. On the service provider side, the SOAP message is parsed and parameters are not properly validated before being used to access a database in a way that does not use parameter binding, thus enabling the attacker to control the structure of the executed SQL query. This pattern describes a SQL injection attack with the delivery mechanism being a SOAP message.
  • Expanding Control over the Operating System from the Database
    An attacker is able to leverage access gained to the database to read / write data to the file system, compromise the operating system, create a tunnel for accessing the host machine, and use this access to potentially attack other machines on the same network as the database machine. Traditionally SQL injections attacks are viewed as a way to gain unauthorized read access to the data stored in the database, modify the data in the database, delete the data, etc. However, almost every data base management system (DBMS) system includes facilities that if compromised allow an attacker complete access to the file system, operating system, and full access to the host running the database. The attacker can then use this privileged access to launch subsequent attacks. These facilities include dropping into a command shell, creating user defined functions that can call system level libraries present on the host machine, stored procedures, etc.
  • SQL Injection
    This attack exploits target software that constructs SQL statements based on user input. An attacker crafts input strings so that when the target software constructs SQL statements based on the input, the resulting SQL statement performs actions other than those the application intended. SQL Injection results from failure of the application to appropriately validate input. When specially crafted user-controlled input consisting of SQL syntax is used without proper validation as part of SQL queries, it is possible to glean information from the database in ways not envisaged during application design. Depending upon the database and the design of the application, it may also be possible to leverage injection to have the database execute system-related commands of the attackers' choice. SQL Injection enables an attacker to talk directly to the database, thus bypassing the application completely. Successful injection can cause information disclosure as well as ability to add or modify data in the database. In order to successfully inject SQL and retrieve information from a database, an attacker:
  • Blind SQL Injection
    Blind SQL Injection results from an insufficient mitigation for SQL Injection. Although suppressing database error messages are considered best practice, the suppression alone is not sufficient to prevent SQL Injection. Blind SQL Injection is a form of SQL Injection that overcomes the lack of error messages. Without the error messages that facilitate SQL Injection, the attacker constructs input strings that probe the target through simple Boolean SQL expressions. The attacker can determine if the syntax and structure of the injection was successful based on whether the query was executed or not. Applied iteratively, the attacker determines how and where the target is vulnerable to SQL Injection. For example, an attacker may try entering something like "username' AND 1=1; --" in an input field. If the result is the same as when the attacker entered "username" in the field, then the attacker knows that the application is vulnerable to SQL Injection. The attacker can then ask yes/no questions from the database server to extract information from it. For example, the attacker can extract table names from a database using the following types of queries: If the above query executes properly, then the attacker knows that the first character in a table name in the database is a letter between m and z. If it doesn't, then the attacker knows that the character must be between a and l (assuming of course that table names only contain alphabetic characters). By performing a binary search on all character positions, the attacker can determine all table names in the database. Subsequently, the attacker may execute an actual attack and send something like:
Access
VectorComplexityAuthentication
NETWORK LOW NONE
Impact
ConfidentialityIntegrityAvailability
PARTIAL PARTIAL PARTIAL
nessus via4
  • NASL family Oracle Linux Local Security Checks
    NASL id ORACLELINUX_ELSA-2012-0369.NASL
    description From Red Hat Security Advisory 2012:0369 : An updated python-sqlalchemy package that fixes one security issue is now available for Red Hat Enterprise Linux 6. The Red Hat Security Response Team has rated this update as having moderate security impact. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available from the CVE link in the References section. SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible, high-level interface to SQL databases. It was discovered that SQLAlchemy did not sanitize values for the limit and offset keywords for SQL select statements. If an application using SQLAlchemy accepted values for these keywords, and did not filter or sanitize them before passing them to SQLAlchemy, it could allow an attacker to perform a SQL injection attack against the application. (CVE-2012-0805) All users of python-sqlalchemy are advised to upgrade to this updated package, which contains a patch to correct this issue. All running applications using SQLAlchemy must be restarted for this update to take effect.
    last seen 2019-02-21
    modified 2018-07-18
    plugin id 68492
    published 2013-07-12
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=68492
    title Oracle Linux 6 : python-sqlalchemy (ELSA-2012-0369)
  • NASL family Mandriva Local Security Checks
    NASL id MANDRIVA_MDVSA-2012-059.NASL
    description It was discovered that SQLAlchemy did not sanitize values for the limit and offset keywords for SQL select statements. If an application using SQLAlchemy accepted values for these keywords, and did not filter or sanitize them before passing them to SQLAlchemy, it could allow an attacker to perform a SQL injection attack against the application (CVE-2012-0805). The updated packages have been patched to correct this issue.
    last seen 2019-02-21
    modified 2019-01-02
    plugin id 61949
    published 2012-09-06
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=61949
    title Mandriva Linux Security Advisory : python-sqlalchemy (MDVSA-2012:059)
  • NASL family CentOS Local Security Checks
    NASL id CENTOS_RHSA-2012-0369.NASL
    description An updated python-sqlalchemy package that fixes one security issue is now available for Red Hat Enterprise Linux 6. The Red Hat Security Response Team has rated this update as having moderate security impact. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available from the CVE link in the References section. SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible, high-level interface to SQL databases. It was discovered that SQLAlchemy did not sanitize values for the limit and offset keywords for SQL select statements. If an application using SQLAlchemy accepted values for these keywords, and did not filter or sanitize them before passing them to SQLAlchemy, it could allow an attacker to perform a SQL injection attack against the application. (CVE-2012-0805) All users of python-sqlalchemy are advised to upgrade to this updated package, which contains a patch to correct this issue. All running applications using SQLAlchemy must be restarted for this update to take effect.
    last seen 2019-02-21
    modified 2018-11-10
    plugin id 58276
    published 2012-03-08
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=58276
    title CentOS 6 : python-sqlalchemy (CESA-2012:0369)
  • NASL family Gentoo Local Security Checks
    NASL id GENTOO_GLSA-201209-16.NASL
    description The remote host is affected by the vulnerability described in GLSA-201209-16 (SQLAlchemy: SQL injection) SQLAlchemy does not properly sanitize input passed from the “limit” and “offset” keywords to the select() function before using it in an SQL query. Impact : A remote attacker could exploit this vulnerability to execute arbitrary SQL statements. Workaround : There is no known workaround at this time.
    last seen 2019-02-21
    modified 2018-07-11
    plugin id 62345
    published 2012-09-27
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=62345
    title GLSA-201209-16 : SQLAlchemy: SQL injection
  • NASL family Debian Local Security Checks
    NASL id DEBIAN_DSA-2449.NASL
    description It was discovered that SQLAlchemy, a SQL toolkit and object relational mapper for Python, is not sanitizing input passed to the limit/offset keywords to select() as well as the value passed to select.limit()/offset(). This allows an attacker to perform SQL injection attacks against applications using SQLAlchemy that do not implement their own filtering.
    last seen 2019-02-21
    modified 2018-11-10
    plugin id 58728
    published 2012-04-13
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=58728
    title Debian DSA-2449-1 : sqlalchemy - missing input sanitization
  • NASL family Scientific Linux Local Security Checks
    NASL id SL_20120307_PYTHON_SQLALCHEMY_ON_SL6.NASL
    description SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible, high-level interface to SQL databases. It was discovered that SQLAlchemy did not sanitize values for the limit and offset keywords for SQL select statements. If an application using SQLAlchemy accepted values for these keywords, and did not filter or sanitize them before passing them to SQLAlchemy, it could allow an attacker to perform a SQL injection attack against the application. (CVE-2012-0805) All users of python-sqlalchemy are advised to upgrade to this updated package, which contains a patch to correct this issue. All running applications using SQLAlchemy must be restarted for this update to take effect.
    last seen 2019-02-21
    modified 2018-12-31
    plugin id 61278
    published 2012-08-01
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=61278
    title Scientific Linux Security Update : python-sqlalchemy on SL6.x
  • NASL family Fedora Local Security Checks
    NASL id FEDORA_2012-3414.NASL
    description - Fix the sqlalchemy0.5 backwards and forwards compat packages for a security problem with limit. 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 2019-02-21
    modified 2018-11-28
    plugin id 58543
    published 2012-04-02
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=58543
    title Fedora 15 : python-sqlalchemy0.5-0.5.8-9.fc15 (2012-3414)
  • NASL family Red Hat Local Security Checks
    NASL id REDHAT-RHSA-2012-0369.NASL
    description An updated python-sqlalchemy package that fixes one security issue is now available for Red Hat Enterprise Linux 6. The Red Hat Security Response Team has rated this update as having moderate security impact. A Common Vulnerability Scoring System (CVSS) base score, which gives a detailed severity rating, is available from the CVE link in the References section. SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible, high-level interface to SQL databases. It was discovered that SQLAlchemy did not sanitize values for the limit and offset keywords for SQL select statements. If an application using SQLAlchemy accepted values for these keywords, and did not filter or sanitize them before passing them to SQLAlchemy, it could allow an attacker to perform a SQL injection attack against the application. (CVE-2012-0805) All users of python-sqlalchemy are advised to upgrade to this updated package, which contains a patch to correct this issue. All running applications using SQLAlchemy must be restarted for this update to take effect.
    last seen 2019-02-21
    modified 2018-11-26
    plugin id 58284
    published 2012-03-08
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=58284
    title RHEL 6 : python-sqlalchemy (RHSA-2012:0369)
  • NASL family Fedora Local Security Checks
    NASL id FEDORA_2012-3412.NASL
    description - Fix the sqlalchemy0.5 backwards and forwards compat packages for a security problem with limit. 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 2019-02-21
    modified 2018-11-28
    plugin id 58542
    published 2012-04-02
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=58542
    title Fedora 16 : python-sqlalchemy0.5-0.5.8-9.fc16 (2012-3412)
  • NASL family Fedora Local Security Checks
    NASL id FEDORA_2012-3373.NASL
    description - Fix the sqlalchemy0.5 backwards and forwards compat packages for a security problem with limit. 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 2019-02-21
    modified 2018-11-28
    plugin id 58687
    published 2012-04-12
    reporter Tenable
    source https://www.tenable.com/plugins/index.php?view=single&id=58687
    title Fedora 17 : python-sqlalchemy0.5-0.5.8-9.fc17 (2012-3373)
redhat via4
advisories
bugzilla
id 783305
title CVE-2012-0805 python-sqlalchemy: SQL injection flaw due to not checking LIMIT input for correct type
oval
AND
  • comment python-sqlalchemy is earlier than 0:0.5.5-3.el6_2
    oval oval:com.redhat.rhsa:tst:20120369005
  • comment python-sqlalchemy is signed with Red Hat redhatrelease2 key
    oval oval:com.redhat.rhsa:tst:20120369006
  • OR
    • comment Red Hat Enterprise Linux 6 Client is installed
      oval oval:com.redhat.rhba:tst:20111656001
    • comment Red Hat Enterprise Linux 6 Server is installed
      oval oval:com.redhat.rhba:tst:20111656002
    • comment Red Hat Enterprise Linux 6 Workstation is installed
      oval oval:com.redhat.rhba:tst:20111656003
    • comment Red Hat Enterprise Linux 6 ComputeNode is installed
      oval oval:com.redhat.rhba:tst:20111656004
rhsa
id RHSA-2012:0369
released 2012-03-07
severity Moderate
title RHSA-2012:0369: python-sqlalchemy security update (Moderate)
rpms python-sqlalchemy-0:0.5.5-3.el6_2
refmap via4
confirm
debian DSA-2449
mandriva MDVSA-2012:059
misc https://bugs.launchpad.net/keystone/+bug/918608
secunia
  • 48327
  • 48328
  • 48771
xf sqlalchemy-select-sql-injection(73756)
Last major update 15-06-2012 - 00:00
Published 05-06-2012 - 18:55
Last modified 17-01-2018 - 21:29
Back to Top