A common method for ensuring that potentially risky inputs are safe before
processing them within the code or communicating with other components is
input validation. An attacker can construct input in a way that is not
anticipated by the rest of the programme when software fails to properly
validate input. This will result in the system's components getting undesired
input, which could change how control is distributed or allow unauthorised
code execution or resource control.
However, there are other methods for processing information than input validation.
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:
raw data - strings, numbers, parameters, file contents, etc.
metadata - information about the raw data, such as headers or size
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:
specified quantities such as size, length, frequency, price, rate, number of operations, time, etc.
implied or derived quantities, such as the actual size of a file instead of a specified size
indexes, offsets, or positions into more complex data structures
symbolic keys or other elements into hash tables, associative arrays, etc.
well-formedness, i.e. syntactic correctness - compliance with expected syntax
lexical token correctness - compliance with rules for what is treated as a token
specified or derived type - the actual type of the input (or what the input appears to be)
consistency - between individual data elements, between raw data and metadata, between references, etc.
conformance to domain-specific rules, e.g. business logic
equivalence - ensuring that equivalent inputs are treated the same
authenticity, ownership, or other attestations about the input, e.g. a cryptographic signature to prove the source of the data
It is frequently necessary for the code itself to calculate or deduce the implied or derived attributes of the data.
Inadequate input validation may be attributed to errors in determining properties.
Be aware that "input validation" can mean a lot of different things to various persons or
classification schemes. When referring or mapping to this CWE entry, exercise caution. For instance,
some flaws might unintentionally allow an attacker to supply an input when they shouldn't be allowed to at all,
yet this is commonly referred to as input validation.
This lab uses django's default template engine, and oviously the input is not validated properly, try to get the admin password hash exploiting it.
This section have active log monitoring section , and some part for user input is also saved in log, can u find some exploit ?
This lab has a login pages, and the input is not validated properly, Can you login as Admin ?