A product that works is not done, as there are many facets to consider - availability, scalability, security. Of those, security is probably the most costly to get wrong.
This talk will build a threat model for a sample web application, showcasing a structured approach to securing your web application. Various vulnerabilities are shown and mitigated, based on current best practices. We take special care to show to eliminate entire classes of vulnerabilities, rather than tackling problems one by one.
The code samples will be built on top of Apache Sling, but previous knowledge of Sling is not required.
Talk delivered at BaselOne 2023
10. A01:2021 - Broken Access Control
bypassing access control checks by modifying the URL, internal application state,
or the HTML page, or by using an attack tool modifying API requests.
viewing or editing someone else's account, by providing its unique identifier
(insecure direct object references)
API with missing access controls for POST, PUT and DELETE.
replaying or tampering with a JSON Web Token (JWT) access control token, or a
cookie or hidden field manipulated to elevate privileges or abusing JWT
invalidation.
10
11. A03:2021 - Injection
User-supplied data is not validated, filtered, or sanitized
Dynamic queries or non-parameterized calls without context-aware escaping are
used directly in the interpreter.
Hostile data is used within object-relational mapping (ORM) search parameters to
extract additional, sensitive records.
Hostile data is directly used or concatenated. The SQL or command contains the
structure and malicious data in dynamic queries, commands, or stored procedures.
11
12. A05:2021 - Security Misconfiguration
Missing appropriate security hardening across any part of the application stack
Improperly configured permissions on cloud services.
Unnecessary features are enabled or installed
Default accounts and their passwords are still enabled and unchanged.
Error handling reveals stack traces or other overly informative error messages to
users.
For upgraded systems, the latest security features are disabled or not configured
securely.
The server does not send security headers or directives, or they are not set to
secure values.
12
13. A06:2021 - Vulnerable and Outdated Components
Vulnerable, unsupported, or out of date software
OS
web/application server
database management system (DBMS)
applications
APIs
components
runtime environments
libraries.
Failure to regularly scan for vulnerabilities
Failure to timely patch security vulnerabilities 13
14. A09:2021 - Security Logging and Monitoring
Failures
Not logging auditable events
logins
failed logins
high-value transactions
Inadequate log messages for warnings and errors
Failure to monitor logs for suspicious activity
Local-only storage for logs
Missing alerting thresholds and response escalation processes
14
15. Threat modelling
OWASP Top 10 (selection)
→ Sample application
Apache Sling primer
Handling security threats
Demo
15
16. Sample application description
simple website
content authors can post articles
authenticated users can post comments
unauthenticated users can read articles and comments
16