Class URLPathValidationPipeline

java.lang.Object
de.cuioss.http.security.pipeline.AbstractValidationPipeline
de.cuioss.http.security.pipeline.URLPathValidationPipeline
All Implemented Interfaces:
HttpSecurityValidator

Sequential validation pipeline specifically for URL path components.

Validation Sequence

  1. Length Validation - Enforces maximum path length limits
  2. Character Validation - Validates RFC 3986 path characters
  3. Decoding - URL decodes with security checks
  4. Normalization - Path normalization and traversal detection
  5. Pattern Matching - Detects injection attacks and suspicious patterns

Design Principles

  • Sequential Execution - Each stage processes the output of the previous stage
  • Early Termination - Pipeline stops on first security violation
  • Security First - Validates before any transformation
  • Immutable - Thread-safe pipeline instance

Usage Example

 SecurityConfiguration config = SecurityConfiguration.defaults();
 SecurityEventCounter counter = new SecurityEventCounter();

 URLPathValidationPipeline pipeline = new URLPathValidationPipeline(config, counter);

 try {
     String safePath = pipeline.validate("/api/users/123");
     // Use safePath for processing
 } catch (UrlSecurityException e) {
     // Handle security violation
     log.warn("Path validation failed: {}", e.getMessage());
 }
 
Implements: Task P1 from HTTP verification specification
Since:
1.0