CVE Vulnerabilities

CVE-2012-1147

Improper Input Validation

Published: Jul 03, 2012 | Modified: Jan 25, 2021
CVSS 3.x
N/A
Source:
NVD
CVSS 2.x
4.3 MEDIUM
AV:N/AC:M/Au:N/C:N/I:N/A:P
RedHat/V2
1.9 LOW
AV:L/AC:M/Au:N/C:N/I:N/A:P
RedHat/V3
Ubuntu
LOW

readfilemap.c in expat before 2.1.0 allows context-dependent attackers to cause a denial of service (file descriptor consumption) via a large number of crafted XML files.

Weakness

The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.

Affected Software

Name Vendor Start Version End Version
Mac_os_x Apple 10.11.0 (including) 10.11.0 (including)
Mac_os_x Apple 10.11.1 (including) 10.11.1 (including)
Apache2 Ubuntu artful *
Apache2 Ubuntu bionic *
Apache2 Ubuntu cosmic *
Apache2 Ubuntu devel *
Apache2 Ubuntu esm-infra-legacy/trusty *
Apache2 Ubuntu esm-infra/bionic *
Apache2 Ubuntu esm-infra/xenial *
Apache2 Ubuntu hardy *
Apache2 Ubuntu lucid *
Apache2 Ubuntu maverick *
Apache2 Ubuntu natty *
Apache2 Ubuntu oneiric *
Apache2 Ubuntu precise *
Apache2 Ubuntu precise/esm *
Apache2 Ubuntu quantal *
Apache2 Ubuntu raring *
Apache2 Ubuntu saucy *
Apache2 Ubuntu trusty *
Apache2 Ubuntu trusty/esm *
Apache2 Ubuntu utopic *
Apache2 Ubuntu vivid *
Apache2 Ubuntu wily *
Apache2 Ubuntu xenial *
Apache2 Ubuntu yakkety *
Apache2 Ubuntu zesty *
Apr-util Ubuntu artful *
Apr-util Ubuntu bionic *
Apr-util Ubuntu cosmic *
Apr-util Ubuntu devel *
Apr-util Ubuntu esm-infra-legacy/trusty *
Apr-util Ubuntu esm-infra/bionic *
Apr-util Ubuntu esm-infra/xenial *
Apr-util Ubuntu hardy *
Apr-util Ubuntu lucid *
Apr-util Ubuntu maverick *
Apr-util Ubuntu natty *
Apr-util Ubuntu oneiric *
Apr-util Ubuntu precise *
Apr-util Ubuntu precise/esm *
Apr-util Ubuntu quantal *
Apr-util Ubuntu raring *
Apr-util Ubuntu saucy *
Apr-util Ubuntu trusty *
Apr-util Ubuntu trusty/esm *
Apr-util Ubuntu utopic *
Apr-util Ubuntu vivid *
Apr-util Ubuntu wily *
Apr-util Ubuntu xenial *
Apr-util Ubuntu yakkety *
Apr-util Ubuntu zesty *
Audacity Ubuntu hardy *
Audacity Ubuntu lucid *
Audacity Ubuntu maverick *
Audacity Ubuntu natty *
Audacity Ubuntu oneiric *
Audacity Ubuntu quantal *
Audacity Ubuntu raring *
Audacity Ubuntu saucy *
Audacity Ubuntu utopic *
Audacity Ubuntu vivid *
Ayttm Ubuntu hardy *
Ayttm Ubuntu lucid *
Ayttm Ubuntu maverick *
Ayttm Ubuntu natty *
Ayttm Ubuntu oneiric *
Ayttm Ubuntu precise *
Ayttm Ubuntu quantal *
Ayttm Ubuntu raring *
Ayttm Ubuntu saucy *
Ayttm Ubuntu utopic *
Ayttm Ubuntu vivid *
Ayttm Ubuntu wily *
Ayttm Ubuntu yakkety *
Cableswig Ubuntu hardy *
Cableswig Ubuntu lucid *
Cableswig Ubuntu maverick *
Cableswig Ubuntu natty *
Cableswig Ubuntu oneiric *
Cableswig Ubuntu precise *
Cableswig Ubuntu quantal *
Cableswig Ubuntu raring *
Cableswig Ubuntu saucy *
Cableswig Ubuntu utopic *
Cableswig Ubuntu vivid *
Cableswig Ubuntu wily *
Cadaver Ubuntu artful *
Cadaver Ubuntu hardy *
Cadaver Ubuntu lucid *
Cadaver Ubuntu maverick *
Cadaver Ubuntu natty *
Cadaver Ubuntu oneiric *
Cadaver Ubuntu precise *
Cadaver Ubuntu quantal *
Cadaver Ubuntu raring *
Cadaver Ubuntu saucy *
Cadaver Ubuntu utopic *
Cadaver Ubuntu vivid *
Cadaver Ubuntu wily *
Cadaver Ubuntu yakkety *
Cadaver Ubuntu zesty *
Celementtree Ubuntu hardy *
Cmake Ubuntu artful *
Cmake Ubuntu bionic *
Cmake Ubuntu cosmic *
Cmake Ubuntu devel *
Cmake Ubuntu esm-infra/bionic *
Cmake Ubuntu esm-infra/xenial *
Cmake Ubuntu hardy *
Cmake Ubuntu lucid *
Cmake Ubuntu maverick *
Cmake Ubuntu natty *
Cmake Ubuntu oneiric *
Cmake Ubuntu precise *
Cmake Ubuntu quantal *
Cmake Ubuntu raring *
Cmake Ubuntu saucy *
Cmake Ubuntu trusty *
Cmake Ubuntu utopic *
Cmake Ubuntu vivid *
Cmake Ubuntu wily *
Cmake Ubuntu xenial *
Cmake Ubuntu yakkety *
Cmake Ubuntu zesty *
Coin3 Ubuntu artful *
Coin3 Ubuntu lucid *
Coin3 Ubuntu maverick *
Coin3 Ubuntu natty *
Coin3 Ubuntu oneiric *
Coin3 Ubuntu precise *
Coin3 Ubuntu quantal *
Coin3 Ubuntu raring *
Coin3 Ubuntu saucy *
Coin3 Ubuntu utopic *
Coin3 Ubuntu vivid *
Coin3 Ubuntu wily *
Coin3 Ubuntu yakkety *
Coin3 Ubuntu zesty *
Expat Ubuntu hardy *
Expat Ubuntu lucid *
Expat Ubuntu maverick *
Expat Ubuntu natty *
Expat Ubuntu oneiric *
Expat Ubuntu precise *
Expat Ubuntu precise/esm *
Expat Ubuntu upstream *
Gdcm Ubuntu lucid *
Gdcm Ubuntu maverick *
Gdcm Ubuntu natty *
Gdcm Ubuntu oneiric *
Gdcm Ubuntu quantal *
Gdcm Ubuntu raring *
Gdcm Ubuntu saucy *
Gdcm Ubuntu utopic *
Gdcm Ubuntu vivid *
Ghostscript Ubuntu artful *
Ghostscript Ubuntu bionic *
Ghostscript Ubuntu cosmic *
Ghostscript Ubuntu devel *
Ghostscript Ubuntu esm-infra/bionic *
Ghostscript Ubuntu esm-infra/xenial *
Ghostscript Ubuntu hardy *
Ghostscript Ubuntu lucid *
Ghostscript Ubuntu maverick *
Ghostscript Ubuntu natty *
Ghostscript Ubuntu oneiric *
Ghostscript Ubuntu precise *
Ghostscript Ubuntu quantal *
Ghostscript Ubuntu raring *
Ghostscript Ubuntu saucy *
Ghostscript Ubuntu trusty *
Ghostscript Ubuntu utopic *
Ghostscript Ubuntu vivid *
Ghostscript Ubuntu wily *
Ghostscript Ubuntu xenial *
Ghostscript Ubuntu yakkety *
Ghostscript Ubuntu zesty *
Grmonitor Ubuntu hardy *
Insighttoolkit Ubuntu hardy *
Insighttoolkit Ubuntu lucid *
Insighttoolkit Ubuntu maverick *
Insighttoolkit Ubuntu natty *
Insighttoolkit Ubuntu oneiric *
Insighttoolkit Ubuntu precise *
Insighttoolkit Ubuntu quantal *
Insighttoolkit Ubuntu raring *
Insighttoolkit Ubuntu saucy *
Insighttoolkit Ubuntu utopic *
Insighttoolkit Ubuntu vivid *
Insighttoolkit Ubuntu wily *
Kompozer Ubuntu hardy *
Kompozer Ubuntu lucid *
Kompozer Ubuntu maverick *
Kompozer Ubuntu natty *
Kompozer Ubuntu oneiric *
Kompozer Ubuntu precise *
Libparagui1.1 Ubuntu hardy *
Libparagui1.1 Ubuntu lucid *
Libparagui1.1 Ubuntu maverick *
Libparagui1.1 Ubuntu natty *
Libparagui1.1 Ubuntu oneiric *
Libparagui1.1 Ubuntu precise *
Matanza Ubuntu artful *
Matanza Ubuntu hardy *
Matanza Ubuntu lucid *
Matanza Ubuntu maverick *
Matanza Ubuntu natty *
Matanza Ubuntu oneiric *
Matanza Ubuntu precise *
Matanza Ubuntu quantal *
Matanza Ubuntu raring *
Matanza Ubuntu saucy *
Matanza Ubuntu utopic *
Matanza Ubuntu vivid *
Matanza Ubuntu wily *
Matanza Ubuntu yakkety *
Matanza Ubuntu zesty *
Paraview Ubuntu lucid *
Paraview Ubuntu maverick *
Paraview Ubuntu natty *
Paraview Ubuntu oneiric *
Paraview Ubuntu quantal *
Paraview Ubuntu raring *
Paraview Ubuntu saucy *
Paraview Ubuntu utopic *
Paraview Ubuntu vivid *
Poco Ubuntu hardy *
Poco Ubuntu lucid *
Poco Ubuntu maverick *
Poco Ubuntu natty *
Poco Ubuntu oneiric *
Poco Ubuntu quantal *
Poco Ubuntu raring *
Poco Ubuntu saucy *
Poco Ubuntu utopic *
Poco Ubuntu vivid *
Python-xml Ubuntu hardy *
Python2.4 Ubuntu hardy *
Python2.5 Ubuntu hardy *
Python2.6 Ubuntu lucid *
Python2.6 Ubuntu maverick *
Python2.6 Ubuntu natty *
Python2.6 Ubuntu oneiric *
Simgear Ubuntu hardy *
Simgear Ubuntu lucid *
Simgear Ubuntu maverick *
Simgear Ubuntu natty *
Simgear Ubuntu oneiric *
Simgear Ubuntu precise *
Simgear Ubuntu quantal *
Simgear Ubuntu raring *
Simgear Ubuntu saucy *
Simgear Ubuntu utopic *
Simgear Ubuntu vivid *
Sitecopy Ubuntu artful *
Sitecopy Ubuntu hardy *
Sitecopy Ubuntu lucid *
Sitecopy Ubuntu maverick *
Sitecopy Ubuntu natty *
Sitecopy Ubuntu oneiric *
Sitecopy Ubuntu precise *
Sitecopy Ubuntu quantal *
Sitecopy Ubuntu raring *
Sitecopy Ubuntu saucy *
Sitecopy Ubuntu utopic *
Sitecopy Ubuntu vivid *
Sitecopy Ubuntu wily *
Sitecopy Ubuntu yakkety *
Sitecopy Ubuntu zesty *
Smart Ubuntu artful *
Smart Ubuntu bionic *
Smart Ubuntu cosmic *
Smart Ubuntu devel *
Smart Ubuntu esm-apps/bionic *
Smart Ubuntu esm-apps/xenial *
Smart Ubuntu hardy *
Smart Ubuntu lucid *
Smart Ubuntu maverick *
Smart Ubuntu natty *
Smart Ubuntu oneiric *
Smart Ubuntu precise *
Smart Ubuntu quantal *
Smart Ubuntu raring *
Smart Ubuntu saucy *
Smart Ubuntu trusty *
Smart Ubuntu utopic *
Smart Ubuntu vivid *
Smart Ubuntu wily *
Smart Ubuntu xenial *
Smart Ubuntu yakkety *
Smart Ubuntu zesty *
Swish-e Ubuntu artful *
Swish-e Ubuntu hardy *
Swish-e Ubuntu lucid *
Swish-e Ubuntu maverick *
Swish-e Ubuntu natty *
Swish-e Ubuntu oneiric *
Swish-e Ubuntu precise *
Swish-e Ubuntu quantal *
Swish-e Ubuntu raring *
Swish-e Ubuntu saucy *
Swish-e Ubuntu utopic *
Swish-e Ubuntu vivid *
Swish-e Ubuntu wily *
Swish-e Ubuntu yakkety *
Swish-e Ubuntu zesty *
Tdom Ubuntu artful *
Tdom Ubuntu lucid *
Tdom Ubuntu maverick *
Tdom Ubuntu natty *
Tdom Ubuntu oneiric *
Tdom Ubuntu precise *
Tdom Ubuntu quantal *
Tdom Ubuntu raring *
Tdom Ubuntu saucy *
Tdom Ubuntu utopic *
Tdom Ubuntu vivid *
Tdom Ubuntu wily *
Tdom Ubuntu yakkety *
Tdom Ubuntu zesty *
Texlive-bin Ubuntu artful *
Texlive-bin Ubuntu bionic *
Texlive-bin Ubuntu cosmic *
Texlive-bin Ubuntu devel *
Texlive-bin Ubuntu esm-infra/bionic *
Texlive-bin Ubuntu esm-infra/xenial *
Texlive-bin Ubuntu hardy *
Texlive-bin Ubuntu lucid *
Texlive-bin Ubuntu maverick *
Texlive-bin Ubuntu natty *
Texlive-bin Ubuntu oneiric *
Texlive-bin Ubuntu precise *
Texlive-bin Ubuntu quantal *
Texlive-bin Ubuntu raring *
Texlive-bin Ubuntu saucy *
Texlive-bin Ubuntu trusty *
Texlive-bin Ubuntu utopic *
Texlive-bin Ubuntu vivid *
Texlive-bin Ubuntu wily *
Texlive-bin Ubuntu xenial *
Texlive-bin Ubuntu yakkety *
Texlive-bin Ubuntu zesty *
Tla Ubuntu artful *
Tla Ubuntu hardy *
Tla Ubuntu lucid *
Tla Ubuntu maverick *
Tla Ubuntu natty *
Tla Ubuntu oneiric *
Tla Ubuntu precise *
Tla Ubuntu quantal *
Tla Ubuntu raring *
Tla Ubuntu saucy *
Tla Ubuntu utopic *
Tla Ubuntu vivid *
Tla Ubuntu wily *
Tla Ubuntu yakkety *
Tla Ubuntu zesty *
Vnc4 Ubuntu artful *
Vnc4 Ubuntu bionic *
Vnc4 Ubuntu cosmic *
Vnc4 Ubuntu devel *
Vnc4 Ubuntu esm-apps/bionic *
Vnc4 Ubuntu esm-apps/xenial *
Vnc4 Ubuntu esm-infra-legacy/trusty *
Vnc4 Ubuntu hardy *
Vnc4 Ubuntu lucid *
Vnc4 Ubuntu maverick *
Vnc4 Ubuntu natty *
Vnc4 Ubuntu oneiric *
Vnc4 Ubuntu precise *
Vnc4 Ubuntu quantal *
Vnc4 Ubuntu raring *
Vnc4 Ubuntu saucy *
Vnc4 Ubuntu trusty *
Vnc4 Ubuntu trusty/esm *
Vnc4 Ubuntu upstream *
Vnc4 Ubuntu utopic *
Vnc4 Ubuntu vivid *
Vnc4 Ubuntu wily *
Vnc4 Ubuntu xenial *
Vnc4 Ubuntu yakkety *
Vnc4 Ubuntu zesty *
Vtk Ubuntu hardy *
Vtk Ubuntu lucid *
Vtk Ubuntu maverick *
Vtk Ubuntu natty *
Vtk Ubuntu oneiric *
Vtk Ubuntu precise *
Vtk Ubuntu quantal *
Vtk Ubuntu raring *
Vtk Ubuntu saucy *
Vtk Ubuntu utopic *
Vtk Ubuntu vivid *
Vtk Ubuntu wily *
W3c-libwww Ubuntu hardy *
Wbxml2 Ubuntu artful *
Wbxml2 Ubuntu hardy *
Wbxml2 Ubuntu lucid *
Wbxml2 Ubuntu maverick *
Wbxml2 Ubuntu natty *
Wbxml2 Ubuntu oneiric *
Wbxml2 Ubuntu precise *
Wbxml2 Ubuntu quantal *
Wbxml2 Ubuntu raring *
Wbxml2 Ubuntu saucy *
Wbxml2 Ubuntu utopic *
Wbxml2 Ubuntu vivid *
Wbxml2 Ubuntu wily *
Wbxml2 Ubuntu yakkety *
Wbxml2 Ubuntu zesty *
Wxwidgets2.6 Ubuntu hardy *
Wxwidgets2.6 Ubuntu lucid *
Wxwidgets2.6 Ubuntu maverick *
Wxwidgets2.6 Ubuntu natty *
Wxwidgets2.6 Ubuntu oneiric *
Wxwidgets2.6 Ubuntu precise *
Wxwidgets2.8 Ubuntu hardy *
Wxwidgets2.8 Ubuntu lucid *
Wxwidgets2.8 Ubuntu maverick *
Wxwidgets2.8 Ubuntu natty *
Wxwidgets2.8 Ubuntu oneiric *
Wxwidgets2.8 Ubuntu precise *
Wxwidgets2.8 Ubuntu quantal *
Wxwidgets2.8 Ubuntu raring *
Wxwidgets2.8 Ubuntu saucy *
Wxwidgets2.8 Ubuntu utopic *
Wxwidgets2.8 Ubuntu vivid *
Wxwidgets2.8 Ubuntu wily *
Wxwindows2.4 Ubuntu hardy *
Xmlrpc-c Ubuntu artful *
Xmlrpc-c Ubuntu bionic *
Xmlrpc-c Ubuntu cosmic *
Xmlrpc-c Ubuntu devel *
Xmlrpc-c Ubuntu esm-apps/bionic *
Xmlrpc-c Ubuntu esm-apps/xenial *
Xmlrpc-c Ubuntu esm-infra-legacy/trusty *
Xmlrpc-c Ubuntu hardy *
Xmlrpc-c Ubuntu lucid *
Xmlrpc-c Ubuntu maverick *
Xmlrpc-c Ubuntu natty *
Xmlrpc-c Ubuntu oneiric *
Xmlrpc-c Ubuntu precise *
Xmlrpc-c Ubuntu quantal *
Xmlrpc-c Ubuntu raring *
Xmlrpc-c Ubuntu saucy *
Xmlrpc-c Ubuntu trusty *
Xmlrpc-c Ubuntu trusty/esm *
Xmlrpc-c Ubuntu utopic *
Xmlrpc-c Ubuntu vivid *
Xmlrpc-c Ubuntu wily *
Xmlrpc-c Ubuntu xenial *
Xmlrpc-c Ubuntu yakkety *
Xmlrpc-c Ubuntu zesty *
Xotcl Ubuntu artful *
Xotcl Ubuntu lucid *
Xotcl Ubuntu maverick *
Xotcl Ubuntu natty *
Xotcl Ubuntu oneiric *
Xotcl Ubuntu precise *
Xotcl Ubuntu quantal *
Xotcl Ubuntu raring *
Xotcl Ubuntu saucy *
Xotcl Ubuntu utopic *
Xotcl Ubuntu vivid *
Xotcl Ubuntu wily *
Xotcl Ubuntu yakkety *
Xotcl Ubuntu zesty *
Xulrunner Ubuntu hardy *

Extended Description

Input validation is a frequently-used technique for checking potentially dangerous inputs in order to ensure that the inputs are safe for processing within the code, or when communicating with other components. When software does not validate input properly, an attacker is able to craft the input in a form that is not expected by the rest of the application. This will lead to parts of the system receiving unintended input, which may result in altered control flow, arbitrary control of a resource, or arbitrary code execution. Input validation is not the only technique for processing input, however. Other techniques attempt to transform potentially-dangerous input into something safe, such as filtering (CWE-790) - which attempts to remove dangerous inputs - or encoding/escaping (CWE-116), which attempts to ensure that the input is not misinterpreted when it is included in output to another component. Other techniques exist as well (see CWE-138 for more examples.) Input validation can be applied to:

Data can be simple or structured. Structured data can be composed of many nested layers, composed of combinations of metadata and raw data, with other simple or structured data. Many properties of raw data or metadata may need to be validated upon entry into the code, such as:

Implied or derived properties of data must often be calculated or inferred by the code itself. Errors in deriving properties may be considered a contributing factor to improper input validation.

Note that “input validation” has very different meanings to different people, or within different classification schemes. Caution must be used when referencing this CWE entry or mapping to it. For example, some weaknesses might involve inadvertently giving control to an attacker over an input when they should not be able to provide an input at all, but sometimes this is referred to as input validation. Finally, it is important to emphasize that the distinctions between input validation and output escaping are often blurred, and developers must be careful to understand the difference, including how input validation is not always sufficient to prevent vulnerabilities, especially when less stringent data types must be supported, such as free-form text. Consider a SQL injection scenario in which a person’s last name is inserted into a query. The name “O’Reilly” would likely pass the validation step since it is a common last name in the English language. However, this valid name cannot be directly inserted into the database because it contains the “’” apostrophe character, which would need to be escaped or otherwise transformed. In this case, removing the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.

Potential Mitigations

  • Assume all input is malicious. Use an “accept known good” input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, “boat” may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as “red” or “blue.”
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code’s environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
  • Even though client-side checks provide minimal benefits with respect to server-side security, they are still useful. First, they can support intrusion detection. If the server receives input that should have been rejected by the client, then it may be an indication of an attack. Second, client-side error-checking can provide helpful feedback to the user about the expectations for valid input. Third, there may be a reduction in server-side processing time for accidental input errors, although this is typically a small savings.
  • Inputs should be decoded and canonicalized to the application’s current internal representation before being validated (CWE-180, CWE-181). Make sure that your application does not inadvertently decode the same input twice (CWE-174). Such errors could be used to bypass allowlist schemes by introducing dangerous inputs after they have been checked. Use libraries such as the OWASP ESAPI Canonicalization control.
  • Consider performing repeated canonicalization until your input does not change any more. This will avoid double-decoding and similar scenarios, but it might inadvertently modify inputs that are allowed to contain properly-encoded dangerous content.

References