Quick Snapshot on Threats, Vulnerabilities, Attack and Defense.
This blog focuses on Secure Java Coding standards for the following Vulnerabilities.
- Unvalidated Inputs
- Cross-Site Scripting (XSS)
- SQL Inject flows
- Improper Error Handling
Unvalidated Inputs
Attacker can change any value of the input submitted to the Web Server
Re-validate all the inputs at the server
Take only the necessary information (user input) from a for submission
Cross Site Scripting (XSS)
Attacker
Injects code into the input data
Hide malicious code with Unicode
Counter measures
Input validations
Input length check
SQL Injection
Counter Measures
Use prepared statements in SQL
Run with limited privileges
Filter / validate the input
Improper Error Handling
Attacker
Gets system information
Gets Database information
Examples
Stack (Thread) Traces
Database dump
Counter Measures
Sanitize the error message
Avoid sending stack traces to end user.
Customize error pages (HTTP errors 404 etc)
SQL Injection
Attacker
Can inject System commands
Can inject other SQL
Can override access checks
Examples
Add more commands “; select * from users;”
Override access “’ OR 1=1;”
Counter Measures
Use prepared statements in SQL
Run with limited privileges
Filter / validate the input
Improper Error Handling
Attacker
Gets system information
Gets Database information
Examples
Stack (Thread) Traces
Database dump
Counter Measures
Sanitize the error message
Avoid sending stack traces to end user.
Customize error pages (HTTP errors 404 etc)
Comments
Post a Comment