OWASP - Broken Access Control Cryptographic Failures and Injection Vulnerability (Top 3 of 10)
OWASP - Broken Access Control Cryptographic Failures and Injection Vulnerability (Top 3 of 10)
OWASP?
The Open Web Application Security Project
(OWASP) is a non-profit organization
founded in 2001, with the goal of helping
website owners and security experts protect
web applications from cyber attacks. OWASP
has 32,000 volunteers around the world who
perform security assessments and research.
Why is the OWASP Top 10
Important?
OWASP Top 10 is a research project that
offers rankings of and remediation advice
for the top 10 most serious web
application security dangers. The report is
founded on an agreement between
security experts from around the globe.
The risks are graded according to the
severity of the vulnerabilities, the
frequency of isolated security defects, and
the degree of their possible impacts.
Why is the OWASP Top 10
Important?
The aim of the report is to provide web application security
experts and developers with an understanding into the most
common security risks so that they can use the findings of
the report as part of their security practices. This can help
limit the presence of such known risks within their web
applications.
OWASP manages the Top 10 list and has been doing so
since 2003. They update the list every 2-3 years, in keeping
with changes and developments in the AppSec market.
OWASP provides actionable information and acts as an
important checklist and internal Web application
development standard for a lot of the largest organizations
in the world.
Broken Access Control
Access Controls
Content:
oOccurs when malicious JavaScript is injected into a
web page, executing scripts in a victim’s browser.
oExample:
html
Copy
<input type="text" name="comment" value="<?php echo
$_GET['comment']; ?>">
o Potential Attack:
If an attacker enters
<script>alert('Hacked!');</script>, the browser
executes it.
Command Injection
Content:
oOccurs when an attacker injects malicious
system commands into an application that
executes shell commands.
oExample (PHP):
$file = $_GET['file'];
system("cat " . $file);
o Potential Attack:
An attacker could enter file.txt; rm -rf /
to delete system files.
LDAP Injection (Lightweight
directory access protocol )
Content:
oOccurs when unvalidated input is injected into
LDAP queries, allowing unauthorized access.
oExample (PHP):
$ldap_query = "(&(user=" . $_GET['user'] . "))";
o Potential Attack:
An attacker could enter *)(objectClass=*)
to retrieve all LDAP entries.
Prevention Techniques
Use Prepared Statements (SQL Injection Prevention)
Example in PHP (PDO):
$stmt = $pdo->prepare("SELECT * FROM users WHERE username = ?");
$stmt->execute([$username]);
Escape User Input (XSS Prevention)
Example:
echo htmlspecialchars($_GET['comment'], ENT_QUOTES, 'UTF-8');
Validate and Sanitize Inputs
Use functions like filter_var() to filter user input.
Avoid Directly Executing User Input
Never pass user input directly into system commands.
Conclusion:
Injection vulnerabilities are a critical security risk in
web applications.
Proper input validation, sanitization, and the use of
prepared statements can significantly reduce the
risk of these attacks.
Stay proactive in securing your applications to
prevent injection vulnerabilities.