OWASP TOP 10
Cross-site Request Forgery
- Make use of built-in protection.
- Rails includes CSRF,
protect_from_forgery
which is included inapplication_controller.rb
by default.
Access Control - Missing Function Level Access Control
Check if users have access to parts of an application. A malicious user could see every account log as long as there is a valid session if this is not checked.
Base64.urlsafe_decode64.
What is OWASP? 2017
- Injection
- Broken Authentication
- Sensitive data exposure
- XML external entities
- Broken access control (merged with missing function level access control)
- Security misconfiguration
- Cross-site scripting (merged with insecure direct object references)
- Insecure deserialization
- Using components with known vulnerabilities
- Insufficient logging and monitoring
Injection
untrusted data sent. query. unintended commands
- Use safe API taht avoids interpreter. ORM
- Whitelist input
- escape special characters
- LIMIT and others to prevent mass discoloser
Broken Authentication
Pass, key session token
- MFA
- No default CREDs
- weak password checks 10,00 worse passwords
- length complexity rotation policies with passwords
- Haden recovery
- Limit failed login atempts log and alert admins.
- Use server side sessio manager. Random session ID high entrpy.
3. Api fail to protect
- Classify data processed store dor transmited. Identify sensitive data
- apply controls
- Discard sensitive data PCI DSS compliant tokenizat
- Encrypt senstive data at rest
- Upd to date
- Encrypt all intranist data. TLS, HTTP. Encryption
- Disable aching for sensitive data
- Store salt hashing delay factor
- Config and setings config
4. XXE discloses internal files
- Developer training
- use JSOn and avoid serialzation
- Upgraded XML processors. SOAP to V1.2 or higher
- XML DTD processing
- Positive server side vailid filter or sanitization
- Verify XML XSL validates XML XSD validaton
- SAST tools detect XXE
- Virtual patching. Api sec gateways, firewalls.
OWASP Cheat Sheet XXE Prevention
5. Restrictions on what users can do. Trusted server side code.
- Deny by default except public
- access contrl once and reuse minize CORS
- Model access enforece ownershp not Create,Read,Update,Delete date the dont own
- Disable web server directory listing
- Log access control failures
- Rate limit API
- Invlaidate JWT on server after logout
- Dev and QA functional access
6. Insecure default config. cloud HTTP headers and verbose error messages..
- Upgrade systems frameworks and libraries
- Repeatable hardening process. Fast and easy to deploy another locked down environment. Automate process
- Use minimal platform without uncessor features
- Update configs. Cloud storage permission
- Segmented app architecture
- Send security dire
7. XSS no validation or escaping. Date using APi that creates HTML OR JS.
Separate data from untrusted content
- escape XS frameworks
- HTPP request content
- Aplpy context-sensitive encoding
- Content security policy.
8.
- Signal signatures
- strict type constraints
- isolate adnr un code that deserilizes
- log deserialization failures
- restrict monitor connectivity
9.
- remove unused dependencies
- Inventory server and client side dependencies Automate process compostiion analysis
- monitor unmanitained libraries. Patching
10
- ensure input validation logged with user context. Held long enogh
- FOrmat easily cosnumed
- high value transactions audit trail
- Monitoring and alerting
- Incident response and recovery plan