1636
[REF-680]Elliotte Rusty Harold. "Tip: Configure SAX parsers for secure processing". 2005 May 7.
< https://web.archive.org/web/20101005080451/http://www.ibm.com/developerworks/xml/library/xtipcfsx.
html >.2023-04-07.
[REF-500]Bryan Sullivan. "XML Denial of Service Attacks and Defenses". 2009 September. <
https://learn.microsoft.com/en-us/archive/msdn-magazine/2009/november/xml-denial-of-serviceattacks-
and-defenses >.2023-04-07.
[REF-682]Blaise Doughan. "Preventing Entity Expansion Attacks in JAXB". 2011 March 1. < http://
blog.bdoughan.com/2011/03/preventing-entity-expansion-attacks-in.html >.2023-04-07.
CWE-777: Regular Expression without Anchors
Weakness ID : 777
Structure : Simple
Abstraction : Variant
Description
The product uses a regular expression to perform neutralization, but the regular expression is not
anchored and may allow malicious or malformed data to slip through.
Extended Description
When performing tasks such as validating against a set of allowed inputs (allowlist), data is
examined and possibly modified to ensure that it is well-formed and adheres to a list of safe values.
If the regular expression is not anchored, malicious or malformed data may be included before
or after any string matching the regular expression. The type of malicious data that is allowed
will depend on the context of the application and which anchors are omitted from the regular
expression.
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 625 Permissive Regular Expression 1392
Background Details
Regular expressions are typically used to match a pattern of text. Anchors are used in regular
expressions to specify where the pattern should match: at the beginning, the end, or both (the
whole input).
Likelihood Of Exploit
Medium
Common Consequences
Scope Impact Likelihood
Availability
Confidentiality
Access Control
Bypass Protection Mechanism
An unanchored regular expression in the context of an
allowlist will possibly result in a protection mechanism
failure, allowing malicious or malformed data to enter
trusted regions of the program. The specific consequences
will depend on what functionality the allowlist was
protecting.
CWE Version 4.14
CWE-777: Regular Expression without Anchors
CWE-777: Regular Expression without Anchors