Web application security in Java

CELJvWeb
AI narration
Online VM
Java
Developer
e-Learning

Base training

labs

52 Labs

case_study

29 Case Studies

Monthly feed

A combination of repeated and new skills & drills for continuous learning

labs

2-3 labs

case_study

Case study

Platform

Web

Audience

Java developers working on Web applications

Preparedness

General Java and Web development

Standards and references

OWASP, SEI CERT, CWE and Fortify Taxonomy

Outline

  • Cyber security basics
  • The OWASP Top Ten
  • A01 - Broken Access Control
  • A02 - Security Misconfiguration
  • A03 - Software Supply Chain Failures
  • A04 - Cryptographic Failures
  • A05 - Injection
  • A06 - Insecure Design
  • A07 - Authentication Failures
  • A08 - Software or Data Integrity Failures
  • A09 - Logging and Alerting Failures
  • A10 - Mishandling of Exceptional Conditions
  • X02 - Memory Management Failures
  • Wrap up

What you will learn

  • Getting familiar with essential cyber security concepts
  • Identify Web application vulnerabilities and their consequences
  • Learn the security best practices in Java
  • Input validation approaches and principles
  • Understanding Web application security issues
  • Detailed analysis of the OWASP Top Ten elements
  • Putting Web application security in the context of Java
  • Going beyond the low hanging fruits

Description

The course provides a comprehensive exploration of secure coding principles and practices tailored specifically for Java developers. Starting off from the foundations of cybersecurity, you will understand the consequences of insecure code by examining threats through the lens of the CIA triad.

In the main part of the material, you will systematically walk through the various vulnerabilities outlined in the OWASP Top Ten. As you progress through the modules investigating the intricacies of authentication and authorization, through realizing the practical aspects of cryptography, to tackling injection attacks, you will gain a deep understanding of both theoretical concepts and practical skills for securing Java web applications. Further subjects are aligned to some common software security weakness types, such as error handling, code quality or denial of service.

These modules go beyond just the theory. Not only do they identify vulnerabilities, show their consequences, and detail the best practices, but – through hands-on labs and real-world case studies – they offer practical experience in identifying, exploiting, and mitigating these security risks within Java-based web applications.

So that you are prepared for the forces of the dark side.

So that nothing unexpected happens in your code.

Nothing.

Note:

Note: This course content is available as an e-learning subscription. We reserve a period of 3 months to digest the foundational material, after which we activate shorter learning units on a monthly basis. This gives secure coding efforts an initial boost, and builds up sustained readiness over time. These learning units are indicated in red in the table of contents below.

They said about us

I didn't expect this coming

I have been coding for 15 years and never thought I would still come across such important security cornerstones.

Participant , December, 2019

Stockholm, Sweden

Table of contents

  • Authorization
    • Access control basics
    • Access control types
    • Case study – Broken authn/authz in Apache OFBiz
    • Confused deputy
  • Insecure Direct Object Reference
    • Insecure direct object reference (IDOR)
    • Path traversal
    • Case study – RCE via path traversal in Apache OFBiz
    • Lab – Insecure Direct Object Reference
    • Path traversal best practices
  • Horizontal authorization
    • Authorization bypass through user-controlled keys
    • Case study – Remote takeover of Nexx garage doors and alarms
    • Lab – Horizontal authorization
  • File upload
    • Unrestricted file upload
    • Good practices
    • Lab – Unrestricted file upload
    • Case study – File upload vulnerability in Netflix Genie
  • Cross-site Request Forgery (CSRF)
    • Lab – Cross-site Request Forgery
  • Cross-site Request Forgery (CSRF) best practices
    • CSRF best practices
    • CSRF defense in depth
    • CSRF (XSRF) protection in Angular
    • Lab – CSRF protection with tokens
  • SSRF
    • Server-side Request Forgery (SSRF)
    • Case study – SSRF in Ivanti Connect Secure
  • Misconfiguration and XML parsing
    • Configuration principles
    • XML Entities
    • DTD and the entities
    • Entity expansion
  • XML External Entity (XXE)
    • File inclusion with external entities
    • Server-Side Request Forgery with external entities
    • Lab – External entity attack
    • Case study – XXE vulnerability in Ivanti products
  • XXE best practices
    • Preventing XXE
    • Lab – Prohibiting DTD
  • Web security configuration issues
    • Content Security Policy
    • Resource control
    • Fetch directives
    • Source allowlisting
    • Strict CSP: using nonces and hashes
    • Navigation and reporting directives
    • Document restrictions and sandboxing
    • Browser support
    • CSP best practices
    • Cookie attributes
  • Secrets management
    • Hard coded passwords
    • Best practices
    • Lab – Hardcoded password
  • Vulnerable components and dependencies
    • Using vulnerable components
    • Assessing the environment
    • Hardening
    • Untrusted functionality import
    • Supply chain security and the Software Bill of Materials (SBOM)
    • SBOM examples
    • Case study – The Polyfill.io supply chain attack
  • Vulnerability management
    • Patch management
    • Vulnerability databases
    • Vulnerability rating – CVSS
    • Lab – Finding vulnerabilities in third-party components
    • Bug bounty programs
  • Build security
  • Dangerous and obsolete language elements
    • Using dangerous language elements
    • Using obsolete language elements
    • Misusing Java language elements
  • Information exposure
    • Exposure through extracted data and aggregation
    • Case study – Strava data exposure
    • Leaking system information
  • Cryptography for developers
    • Cryptography basics
    • Java Cryptographic Architecture (JCA) in brief
  • Hashing
    • Hashing basics
    • Common hashing mistakes
    • Hashing in Java
    • Lab – Hashing in JCA
  • PRNG
    • Random number generation
    • Pseudo random number generators (PRNGs)
    • Cryptographically secure PRNGs
    • Using virtual random streams
    • Case study – Equifax credit account freeze
  • PRNG in Java
    • Weak and strong PRNGs in Java
    • Using random numbers in Java
    • Lab – Using random numbers in Java
  • Encryption
    • Confidentiality protection
    • Symmetric encryption
    • Block ciphers
    • Modes of operation
    • Modes of operation and IV – best practices
  • Encryption in Java
    • Symmetric encryption in Java
    • Symmetric encryption in Java with streams
    • Lab – Symmetric encryption in JCA
  • Asymmetric encryption
    • The RSA algorithm
    • Using RSA – best practices
    • RSA in Java
    • Case study – RSA attacks: Bleichenbacher, ROBOT, and Marvin
    • Combining symmetric and asymmetric algorithms
  • Key exchange and agreement
    • Key exchange
    • Diffie-Hellman key agreement algorithm
    • Key exchange pitfalls and best practices
  • Injection problems
    • Injection principles
    • Injection attacks
  • SQL injection
    • SQL injection basics
    • Lab – SQL injection
  • SQL injection attack techniques
    • Attack techniques
    • Content-based blind SQL injection
    • Time-based blind SQL injection
  • SQL injection best practices
    • Input validation
    • Parameterized queries
    • Lab – Using prepared statements
  • SQL injection additional considerations
    • Database defense in depth
    • Case study – SQL injection in Fortra FileCatalyst
  • Beyond SQL injection – ORM and NoSQL
    • SQL injection protection and ORM
    • NoSQL injection basics
  • Code injection
    • OS command injection
    • Lab – Command injection
  • OS command injection best practices
    • Using Runtime.exec()
    • Using ProcessBuilder
    • Lab – Command injection best practices
    • Case study – Shellshock
    • Lab – Shellshock
    • Case study – Command injection in VMware Aria
  • HTML injection – Cross-site scripting (XSS)
    • Cross-site scripting basics
    • Persistent cross-site scripting
    • Reflected cross-site scripting
    • Client-side (DOM-based) cross-site scripting
  • XSS attacks
    • Lab – Stored XSS
    • Lab – Reflected XSS
  • XSS best practices 1
    • Protection principles – escaping
    • XSS protection APIs in Java
    • Lab – XSS fix / stored
  • XSS best practices 2
    • XSS protection in JSP
    • Lab – XSS fix / reflected
    • Additional protection layers – defense in depth
    • XSS protection in Angular
    • XSS protection in React
    • Case study – XSS vulnerabilities in DrayTek Vigor routers
  • Advanced XSS
    • Additional XSS exploitation and protection
    • Lab – Stored XSS in attribute
    • Lab – XSS fix / stored (in HTML attributes)
    • Lab – XSS fix / stored (selective)
    • Client-side protection principles
  • Template injection
    • Script injection
    • Case study – Script injection in Kubernetes NGINX Ingress
    • Server-side template injection (SSTI)
    • Case study – RCE via OGNL in Confluence teplates
    • Client-side template injection (CSTI) in Angular
    • Client-side template injection (CSTI) in React
  • Expression language (EL) injection
    • SpEL injection
    • Lab – SpEL injection
    • SpEL injection – testing and best practices
  • Input validation principles 1
    • Input validation principles
    • Denylists and allowlists
    • Data validation techniques
    • Lab – Input validation
  • Input validation principles 2
    • What to validate – the attack surface
    • Where to validate – defense in depth
    • When to validate – validation vs transformations
  • Input validation principles 3
    • Output sanitization
    • Encoding challenges
    • Unicode challenges
    • Lab – Encoding challenges
    • Validation with regex
  • Path traversal and file validation
    • Path traversal
    • Lab – Path traversal
    • Path traversal-related examples
    • Additional challenges in Windows
    • Case study – RCE via path traversal in Apache OFBiz
    • Virtual resources
    • Path traversal best practices
    • Lab – Path canonicalization
  • Unsafe reflection
    • Reflection without validation
    • Lab – Unsafe reflection
    • Are accessibility modifiers a security feature?
    • Accessibility modifiers – best practices
    • Overriding and accessibility modifiers
  • Unsafe native code (JNI)
    • Native code dependence
    • Lab – Unsafe native code
    • Best practices for dealing with native code
  • Insecure design
    • The STRIDE model of threats
    • Secure design principles of Saltzer and Schroeder
  • Insecure design – Saltzer and Schroeder 1
    • Economy of mechanism
    • Fail-safe defaults
    • Complete mediation
    • Open design
  • Insecure design – Saltzer and Schroeder 2
    • Separation of privilege
    • Least privilege
    • Least common mechanism
    • Psychological acceptability
  • Client-side security
    • Same Origin Policy
    • Simple request
    • Preflight request
    • Cross-Origin Resource Sharing (CORS)
  • Clickjacking
    • Frame sandboxing
    • Cross-Frame Scripting (XFS) attacks
    • Lab – Clickjacking
    • Clickjacking beyond hijacking a click
  • Anti-clickjacking best practices
    • Clickjacking protection best practices
    • Lab – Using CSP to prevent clickjacking
  • Authentication
    • Authentication basics
    • Multi-factor authentication (MFA)
    • Case study – The InfinityGauntlet attack
    • Authentication weaknesses
    • Case study – “AuthBiz” broken authentication in Apache OFBiz
  • Session security
    • Session management essentials
    • Why do we protect session IDs – Session hijacking
    • Session fixation
    • Session invalidation
    • Session ID best practices
    • Session handling security considerations in single-page applications
  • Password management
    • Storing account passwords
    • Password in transit
    • Lab – Is just hashing passwords enough?
  • Password storage
  • Password policy
  • Password storage – a case study
    • Case study – The Ashley Madison data breach
    • The dictionary attack
    • The ultimate crack
    • Exploitation and the lessons learned
  • Additional password management challenges
    • Password database migration
    • (Mis)handling null passwords
  • Password auditing
    • Using password cracking tools
    • Password cracking in Windows
    • Lab – Password audit with John the Ripper
    • Lab – On-line password brute forcing
    • Password recovery issues
    • Password recovery best practices
    • Lab – Password reset weakness
    • Case study – GitLab account takeover
  • Protecting secrets in memory
    • Challenges in protecting memory
    • Case study – Microsoft secret key theft via dump files
    • Storing sensitive data in memory
    • Lab – Using secret-handling classes in Java
  • Integrity protection and MAC
    • Integrity protection
    • Message Authentication Code (MAC)
    • Calculating MAC in Java
    • Lab – Calculating MAC in JCA
  • Digital signatures
    • Digital signature
    • Digital signature with RSA
    • ECC basics
    • Digital signature with ECC
    • Digital signature in Java
    • Lab – Digital signature with ECDSA in JCA
  • Subresource integrity
    • Importing JavaScript
    • Lab – Importing JavaScript
    • Subresource integrity in Angular
    • Case study – The British Airways data breach
  • Insecure deserialization
    • Serialization and deserialization challenges
    • Integrity – deserializing untrusted streams
    • Integrity – deserialization best practices
    • Using readObject
    • Look ahead deserialization
  • Property Oriented Programming
    • Property Oriented Programming (POP)
    • Creating a POP payload
    • Lab – Creating a POP payload
  • POP exploitation and best practices
    • Lab – Using the POP payload
    • Summary – POP best practices
    • Case study – Deserialization RCEs in NextGen Mirth Connect
    • DoS with deserialization
    • Lab – Billion laughs with deserialization
  • Protecting Java code
    • Protecting Java code and applications
    • Code signing
    • Lab – Code signing and permissions
    • Security implications of jlink
  • Logging
    • Logging and monitoring principles
    • Insufficient logging
    • Case study – Plaintext passwords at Facebook
    • Logging best practices
  • Log forging
    • Newline injection
    • Web log forging
    • Log forging – best practices
    • Case study – Log interpolation in log4j
    • Case study – The Log4Shell vulnerability (CVE-2021-44228)
    • Case study – Log4Shell follow-ups (CVE-2021-45046, CVE-2021-45105)
    • Lab – Log4Shell
  • Monitoring
    • Monitoring best practices
    • Firewalls and Web Application Firewalls (WAF)
    • Intrusion detection and prevention
    • Case study – The Marriott Starwood data breach
  • Principles
    • Error and exception handling principles
    • Information exposure through error reporting
    • Information leakage via error pages
    • Returning a misleading status code
    • Reachable assertion
  • Exception handling
    • In the catch block. And now what?
    • Catching NullPointerException
    • Empty catch block
    • Overly broad throws
    • Improper completing of the finally block
    • Throwing undeclared checked exceptions
    • Swallowed ThreadDeath
    • Throwing RuntimeException or Throwable
    • Lab – Exception handling mess
  • Control flow and error handling
    • Incorrect block delimitation
    • Dead code
    • Using if-then-else and switch defensively
  • Denial of service
    • Flooding
    • Resource exhaustion
  • Sustained client engagement
    • Infinite loop
    • Denial of service problems in Java
    • Economic Denial of Sustainability (EDoS)
  • Amplification
    • Some amplification examples
  • Algorithmic complexity issues
    • Regular expression denial of service (ReDoS)
    • Lab – ReDoS
    • Dealing with ReDoS
  • Integer handling problems
    • Representing signed numbers
    • Integer visualization
    • Integer overflow
    • Lab – Integer overflow
    • Division by zero
    • Working with floating-point numbers
  • Integer handling problems 2
    • Signed / unsigned confusion
    • Case study – The Stockholm Stock Exchange
    • Integer truncation
  • Integer best practices
    • Upcasting
    • Precondition testing
    • Postcondition testing
    • Using big integer libraries
  • Integer best practices in Java
    • Integer handling
    • Lab – Integer handling
  • Resource leakage
    • Unreleased resource
    • Unreleased resource – Synchronization
    • Unreleased resource – Various
    • The finalize() method – best practices
  • Software security principles
    • Principles of robust programming by Matt Bishop
  • Sources and further readings
    • Software security sources and further reading
    • Java resources

Pricing

1 year subscription license

599 EUR / person

  • E-learning subscription for sustained readiness
  • Discussion and insight into the hacker’s mindset
  • Hands-on practice, lab exercises using live drills
  • Case studies based on high-profile hacks
Customized course

Tailor a course to your preferences

  • Send us a brief description of your business’s training needs
  • Include your contact information
  • One of our colleagues will be in touch to schedule a free consultation about training requirements

Inquiry

Interested in the trainings but still have some questions? Curious about how you can customize a training for your team? Send us a message and a team member will be in touch within 24 hours.

This field is required

This field is required

Send us your phone number if you prefer to discuss further on a call

This field is required

This field is required

This field is required

This field is required