Back to course catalog

Java and Web application security master course

CL-JSM
5 days
Java, Web
Course page in PDF Inquiry

Course information

Preparedness

Advanced Java and Web application development

Exercises

Hands-on

Delivery methods

Classroom

Course Reviews

The exercises were not spoon-fed. We had to apply the learned material to solve.

February 2018 Minneapolis, MN

View all reviews

The exercises were vital to developing a clear working understanding of the concepts.

February 2018 Minneapolis, MN

View all reviews

The exercises were by far my favorite part. Case studies were great also!

October 2016 Minneapolis, MN

View all reviews

Loved the lab and code analysis we did. I also liked the material in the slides, well diversified and can catch interest in many areas!

October 2016 Minneapolis, MN

View all reviews

There is a lot of good information in the course. Case studies and concrete examples were very good.

October 2016 Minneapolis, MN

View all reviews

The hands on exercises were very fun!

December 2016 Minneapolis, MN

View all reviews

The case studies were useful to me. The fact that they were from recent events was also a good thing!

December 2016 Minneapolis, MN

View all reviews

Description

As a developer, your duty is to write bulletproof code. However...

What if we told you that despite all of your efforts, the code you have been writing your entire career is full of weaknesses you never knew existed? What if, as you are reading this, hackers were trying to break into your code? How likely would they be to succeed?

This advanced course will change the way you look at code. A hands-on training during which we will teach you all of the attackers’ tricks and how to mitigate them, leaving you with no other feeling than the desire to know more.

It is your choice to be ahead of the pack, and be seen as a game changer in the fight against cybercrime.

Participants attending this course will

  • Understand basic concepts of security, IT security and secure coding
  • Learn Web vulnerabilities beyond OWASP Top Ten and know how to avoid them
  • Learn about XML security
  • Learn client-side vulnerabilities and secure coding practices
  • Have a practical understanding of cryptography
  • Learn to use various security features of the Java development environment
  • Learn about typical coding mistakes and how to avoid them
  • Get information about some recent vulnerabilities in the Java framework
  • Understand security concepts of Web services
  • Learn about JSON security
  • Learn about Hibernate security
  • Understand security solutions of Java EE
  • Learn about JSF and PrimeFaces security
  • Learn about Spring security
  • Learn about denial of service attacks and protections
  • Get practical knowledge in using security testing techniques and tools
  • Get sources and further readings on secure coding practices

Outline

  • IT security and secure coding
  • Web application security (OWASP Top Ten 2017)
  • Client-side security
  • Practical cryptography
  • Java security services
  • Foundations of Java security
  • Secure communication in Java
  • Common coding errors and vulnerabilities
  • Security of Web services
  • Hibernate security
  • Java EE security
  • JSF and PrimeFaces security
  • Spring security
  • Denial of service
  • Security testing techniques and tools
  • Principles of security and secure coding
  • Knowledge sources

Table of Contents

  • Day 1
    • IT security and secure coding
      • Nature of security
      • What is risk?
      • IT security vs. secure coding
      • From vulnerabilities to botnets and cybercrime
        • Nature of security flaws
        • Reasons of difficulty
        • From an infected computer to targeted attacks
    • Web application security (OWASP Top Ten 2017)
      • OWASP Top Ten 2017
      • A1 - Injection
        • Injection principles
        • SQL injection
          • Exercise – SQL injection
          • Typical SQL Injection attack methods
          • Blind and time-based SQL injection
          • SQL injection protection methods
          • Effect of data storage frameworks on SQL injection in Java
        • Other injection flaws
          • Command injection
          • Case study – ImageMagick
      • A2 - Broken authentication
        • Session handling threats
        • Session handling best practices
        • Session handling in Java
        • Setting cookie attributes – best practices
        • Cross site request forgery (CSRF)
          • CSRF prevention
          • CSRF prevention in Java frameworks
      • A3 - Sensitive data exposure
        • Sensitive data exposure
        • Transport layer security
          • Enforcing HTTPS
      • A4 - XML external entity (XXE)
        • XML Entity introduction
        • XML external entity attack (XXE) – resource inclusion
        • XML external entity attack – URL invocation
        • XML external entity attack – parameter entities
        • Exercise – XXE attack
        • Preventing entity-related attacks
        • Case study – XXE in Google Toolbar
      • A5 - Broken access control
        • Typical access control weaknesses
        • Insecure direct object reference (IDOR)
        • Exercise – Insecure direct object reference
        • Protection against IDOR
        • Case study – Facebook Notes
      • A6 - Security misconfiguration
        • Security misconfiguration
        • Configuring the environment
        • Insecure file uploads
        • Exercise – Uploading executable files
        • Filtering file uploads – validation and configuration
      • A7 - Cross-Site Scripting (XSS)
        • Persistent XSS
        • Reflected XSS
        • DOM-based XSS
        • Exercise – Cross Site Scripting
        • XSS prevention
        • XSS prevention tools in Java and JSP
  • Day 2
    • Web application security (OWASP Top Ten 2017)
      • A8 - Insecure deserialization
        • Deserialization basics
        • Security challenges of deserialization
        • Deserialization in Java
        • From deserialization to code execution
        • POP payload targeting the Apache Commons gadget (Java)
        • Real-world Java examples of deserialization vulnerabilities
        • Issues with deserialization – JSON
        • Best practices against deserialization vulnerabilities
      • A9 - Using components with known vulnerabilities
        • Vulnerability attributes
        • Common Vulnerability Scoring System – CVSS
      • A10 - Insufficient logging and monitoring
        • Detection and response
        • Logging and log analysis
        • Intrusion detection systems and Web application firewalls
    • Client-side security
      • JavaScript security
      • Same Origin Policy
      • Cross Origin Resource Sharing (CORS)
      • Exercise – Client-side authentication
      • Client-side authentication and password management
      • Protecting JavaScript code
      • Clickjacking
        • Clickjacking
        • Exercise – Do you Like me?
        • Protection against Clickjacking
        • Anti frame-busting – dismissing protection scripts
        • Protection against busting frame busting
      • AJAX security
        • XSS in AJAX
        • Script injection attack in AJAX
        • Exercise – XSS in AJAX
        • XSS protection in Ajax
        • Exercise CSRF in AJAX – JavaScript hijacking
        • CSRF protection in AJAX
      • HTML5 security
        • New XSS possibilities in HTML5
        • HTML5 clickjacking attack – text field injection
        • HTML5 clickjacking – content extraction
        • Form tampering
        • Exercise – Form tampering
        • Cross-origin requests
        • HTML proxy with cross-origin request
        • Exercise – Client side include
    • Practical cryptography
      • Rule #1 of implementing cryptography
      • Cryptosystems
        • Elements of a cryptosystem
      • Symmetric-key cryptography
        • Providing confidentiality with symmetric cryptography
        • Symmetric encryption algorithms
        • Modes of operation
      • Other cryptographic algorithms
        • Hash or message digest
        • Hash algorithms
        • SHAttered
        • Message Authentication Code (MAC)
        • Providing integrity and authenticity with a symmetric key
        • Random numbers and cryptography
        • Cryptographically-strong PRNGs
        • Hardware-based TRNGs
      • Asymmetric (public-key) cryptography
        • Providing confidentiality with public-key encryption
        • Rule of thumb – possession of private key
        • Combining symmetric and asymmetric algorithms
      • Public Key Infrastructure (PKI)
        • Man-in-the-Middle (MitM) attack
        • Digital certificates against MitM attack
        • Certificate Authorities in Public Key Infrastructure
        • X.509 digital certificate
    • Java security services
      • Java security services – architecture
      • Java Cryptographic Architecture
        • Java Cryptography Architecture / Extension (JCA/JCE)
        • Using Cryptographic Service Providers
        • Engine classes and algorithms
        • Exercise Sign – Generating and verifying signatures
  • Day 3
    • Foundations of Java security
      • The Java environment
      • Low-level security – the Java language and environment
        • Java language security
        • Type safety
        • Automatic memory management
        • Java execution overview
        • Bytecode Verifier
        • Class Loader
        • Protecting Java code
      • High-level security – access control
        • Protection domains
        • Security Manager and Access Controller
        • Permission checking
        • Effects of doPrivileged
        • Exercise Jars – Granting permission to signed code
    • Secure communication in Java
      • Security services
      • SSL/TLS handshake
      • Java Secure Socket Extension (JSSE)
      • Exercise Https – Switching from HTTP to HTTPS
      • Public Key Infrastructure support
        • The Java Keystore (JKS)
        • Java Certification Path (CertPath)
    • Common coding errors and vulnerabilities
      • Input validation
        • Input validation concepts
        • Integer problems
          • Representation of negative integers
          • Integer overflow
          • Exercise IntOverflow
          • What is the value of Math.abs(Integer.MIN_VALUE)?
          • Integer problem – best practices
          • Java case study
        • Path traversal vulnerability
          • Path traversal – best practices
          • Case study – Insufficient URL validation in LastPass
        • Unvalidated redirects and forwards
        • Unsafe native calls
          • Unsafe JNI
          • Exercise Unsafe JNI
        • Unsafe reflection
          • Implementation of a command dispatcher
          • Unsafe reflection – spot the bug!
          • Mitigation of unsafe reflection
        • Log forging
          • Some other typical problems with log files
    • Security of Web services
      • Securing web services – two general approaches
      • SOAP - Simple Object Access Protocol
      • Security of RESTful web services
        • Authenticating users in RESTful web services
        • Authentication with JSON Web Tokens (JWT)
        • Authorization with REST
        • Vulnerabilities in connection with REST
      • XML security
        • Introduction
        • XML parsing
        • XML injection
          • (Ab)using CDATA to store XSS payload in XML
          • Exercise – XML injection
          • Protection through sanitization and XML validation
          • XML bomb
          • Exercise – XML bomb
      • JSON security
        • JSON parsing
        • Embedding JSON server-side
        • JSON injection
        • JSON hijacking
        • Case study – XSS via spoofed JSON element
  • Day 4
    • Common coding errors and vulnerabilities
      • Improper use of security features
        • Typical problems related to the use of security features
        • Insecure randomness
          • Weak PRNGs in Java
          • Exercise RandomTest
          • Using random numbers in Java – spot the bug!
        • Password management
          • Exercise – Weakness of hashed passwords
          • Password management and storage
          • Special purpose hash algorithms for password storage
          • Argon2 and PBKDF2 implementations in Java
          • bcrypt and scrypt implementations in Java
          • Case study – the Ashley Madison data breach
          • Typical mistakes in password management
          • Exercise – Hard coded passwords
        • Accessibility modifiers
          • Accessing private fields with reflection in Java
          • Exercise Reflection – Accessing private fields with reflection
        • Exercise ScademyPay – Integrity protection weakness
    • Hibernate security
      • Hibernate security overview
        • The Hibernate framework and ecosystem
        • Persistence-related security issues
      • Hibernate-specific vulnerabilities
        • HQL injection
        • HQL injection exercise
        • Bypassing the HQL lexer
        • ASTification example
        • Protection against HQL injection
        • Persisting tainted objects (XSS)
        • Hibernate Validator
        • Hibernate Validator example
        • Hibernate Validator exercise
        • The equals() and hashCode() problem
        • Other Hibernate related issues and recommendations
        • Other query possibilities in Hibernate
        • Case studies – Some weaknesses of the Hibernate platform
          • CVE-2014-3558: Restriction bypass by ReflectionHelper
          • CVE-2016-1595: Service Desk HQL Injection Vulnerability
    • Java EE security
      • Java EE multi-tier architecture
      • Roles and responsibilities
      • Java EE container-based security
      • Basic concepts: user, group, role, realm
      • Security of the Web/Presentation tier
        • Java EE authorization
        • Declaring security roles
        • Checking the caller’s identity programmatically
        • Security constraints
        • Exercise WebSecurity – Using JDBC realm
      • Security of the EJB/Business tier
        • Propagating the identity
        • Declaring EJB security roles
        • EJB authorization – annotation
        • EJB authorization – deployment descriptor
        • Accessing the caller’s context programmatically
        • Exercise EJBSecurity
        • Exercise EJBSecurity – Preparation
        • Exercise EJBSecurity – Run
        • Exercise EJBSecurity – Enforce authentication
    • JSF and PrimeFaces security
      • The Java Server Faces (JSF)
      • PrimeFaces
      • JSF ViewState
        • ViewState (POST)
        • ViewState (GET)
      • Common mistakes
        • JSF/PrimeFaces attack surface
        • Preventing XSS
        • XSS Exercise
        • XSS Exercise – Apply escaping and validation in JSF
        • XSS Exercise – Fixes in Primefaces
        • CSRF Exercise
        • EL Injection (Expression Language Injection)
        • Exercise – EL Injection
        • Case studies – Some weaknesses of JSF & PrimeFaces
          • CVE-2011-4367: Apache MyFaces information disclosure
          • PrimeFaces 5.x Expression Language Injection
  • Day 5
    • Spring security
      • Spring security overview
        • What makes Spring different?
        • Spring modules
        • Inversion of Control
        • Aspect Oriented Programming (AOP)
        • Aspect Oriented Programming (AOP) and security
      • The Spring Security framework
        • Spring Security overview
        • Integrating the Spring Security framework
        • Spring Security - authentication
          • The authentication process
          • Authentication code example
          • CSRF protection in Spring
        • Spring Security - authorization
          • The authorization process
          • Page-level authorization
          • Customizing FilterSecurityInterceptor
          • Exercise: Spring Security authentication example
          • Defining and working with ACLs
          • SpEL integration with Spring Security access control
          • Custom authorization
          • Using a custom PermissionEvaluator
        • Method-level security
          • Method-level security
          • Method-level security using SpEL
    • Common coding errors and vulnerabilities
      • Improper error and exception handling
        • Typical problems with error and exception handling
        • Empty catch block
        • Overly broad throws
        • Overly broad catch
        • Using multi-catch
        • Catching NullPointerException
        • Exception handling – spot the bug!
        • Exercise ScademyPay – Error handling
      • Time and state problems
        • Time and state related problems
        • Concurrency – spot the bug!
        • Calling Thread.run()
        • Race condition in servlets – spot the bug!
        • Race condition – spot the bug!
        • ArrayList vs Vector
      • Code quality problems
        • Dangers arising from poor code quality
        • Poor code quality – spot the bug!
        • Unreleased resources
        • Private arrays – spot the bug!
        • Private arrays – typed field returned from a public method
        • Exercise Object Hijack
        • Public method without final – object hijacking
        • Serialization – spot the bug!
        • Exercise Serializable Sensitive
        • Immutable String – spot the bug!
        • Exercise Immutable Strings
        • Immutability and security
    • Denial of service
      • DoS introduction
      • Asymmetric DoS
      • SSL/TLS renegotiation DoS
      • Asymmetric DOS with JSON deserialization
      • Regular expression DoS (ReDoS)
        • Exercise ReDoS
        • ReDoS mitigation
        • Case study – ReDos in Stack Exchange
      • Hashtable collision attack
        • Using hashtables to store inputs
        • Hashtable collision
        • Hashtable collision in Java
    • Security testing techniques and tools
      • General testing approaches
      • Source code review
        • Code review for software security
        • Taint analysis
        • Heuristic-based
        • Static code analysis
          • Static code analysis
          • Exercise – Using static code analysis tools
      • Testing the implementation
        • Dynamic security testing
        • Manual vs. automated security testing
        • Web vulnerability scanners
          • Exercise – Using a vulnerability scanner
          • SQL injection tools
          • Exercise – Using SQL injection tools
    • Principles of security and secure coding
      • Matt Bishop’s principles of robust programming
      • The security principles of Saltzer and Schroeder
    • Knowledge sources
      • Secure coding sources – a starter kit
      • Vulnerability databases
      • Java secure coding sources
      • Recommended books – Java
Show full table of contents

Get more information