1767
References
[REF-786]Jim Manico. "Injection-safe templating languages". 2010 June 0. < https://
manicode.blogspot.com/2010/06/injection-safe-templating-languages_30.html >.2023-04-07.
[REF-787]Dinis Cruz. "Can we please stop saying that XSS is boring and easy to fix!". 2010
September 5. < http://diniscruz.blogspot.com/2010/09/can-we-please-stop-saying-that-xss-is.html
>.
[REF-788]Ivan Ristic. "Canoe: XSS prevention via context-aware output encoding". 2010
September 4. < https://blog.ivanristic.com/2010/09/introducing-canoe-context-aware-outputencoding-
for-xss-prevention.html >.2023-04-07.
[REF-789]Jim Manico. "What is the Future of Automated XSS Defense Tools?". 2011 March 8. <
http://software-security.sans.org/downloads/appsec-2011-files/manico-appsec-future-tools.pdf >.
[REF-709]Jeremiah Grossman, Robert "RSnake" Hansen, Petko "pdp" D. Petkov, Anton Rager and
Seth Fogie. "XSS Attacks". 2007. Syngress.
[REF-725]OWASP. "DOM based XSS Prevention Cheat Sheet". < http://www.owasp.org/index.php/
DOM_based_XSS_Prevention_Cheat_Sheet >.
[REF-45]OWASP. "OWASP Enterprise Security API (ESAPI) Project". < http://www.owasp.org/
index.php/ESAPI >.
CWE-839: Numeric Range Comparison Without Minimum Check
Weakness ID : 839
Structure : Simple
Abstraction : Base
Description
The product checks a value to ensure that it is less than or equal to a maximum, but it does not
also verify that the value is greater than or equal to the minimum.
Extended Description
Some products use signed integers or floats even when their values are only expected to be
positive or 0. An input validation check might assume that the value is positive, and only check for
the maximum value. If the value is negative, but the code assumes that the value is positive, this
can produce an error. The error may have security consequences if the negative value is used
for memory allocation, array access, buffer access, etc. Ultimately, the error could lead to a buffer
overflow or other type of memory corruption.
The use of a negative number in a positive-only context could have security implications for other
types of resources. For example, a shopping cart might check that the user is not requesting more
than 10 items, but a request for -3 items could cause the application to calculate a negative price
and credit the attacker's account.
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 1023 Incomplete Comparison with Missing Factors 1865
CWE Version 4.14
CWE-839: Numeric Range Comparison Without Minimum Check
CWE-839: Numeric Range Comparison Without Minimum Check