- All Implemented Interfaces:
Serializable,Comparable<UrlSecurityFailureType>,Constable
Comprehensive enumeration of security failure types for URL validation.
Each failure type represents a specific class of security violation that
can occur during URL processing and validation.
Design Principles
- Comprehensive Coverage - Covers all major URL security attack vectors
- Clear Categorization - Groups related failure types for easier handling
- Descriptive Names - Self-documenting enum values
- Immutable Design - Thread-safe for concurrent validation
Usage Example
if (containsPathTraversal(path)) {
throw UrlSecurityException.builder()
.failureType(UrlSecurityFailureType.PATH_TRAVERSAL_DETECTED)
.input(path)
.build();
}
Implements: Task B1 from HTTP verification specification- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionControl characters that could manipulate processing detectedAttempt to escape from allowed directory structure detectedDouble URL encoding patterns detected (e.g., %252e for double-encoded '.')Excessive directory nesting depth detectedInput exceeds configured maximum length limitsInvalid or dangerous characters found in URLInvalid URL encoding sequences detected (e.g., incomplete percent encoding)Invalid host format detectedInvalid IPv6 address format detectedInput structure violates expected formatInvalid URL format detectedKnown attack signatures from security databasesInput structure is malformed or corruptedMalformed URL structure detectedNull byte injection attack detected (e.g., )Path exceeds configured maximum length limitsPath traversal patterns like "../" or equivalent encodings detectedGeneral protocol specification violationRFC specification violation (HTTP, URI, etc.)Suspicious parameter name commonly used in attacksSuspicious patterns that match attack signaturesUnicode normalization changed the input, potentially bypassing security checks -
Method Summary
Modifier and TypeMethodDescriptionReturns the human-readable description of this failure type.booleanIndicates whether this failure type represents a character-based attack.booleanIndicates whether this failure type represents an encoding-related issue.booleanIndicates whether this failure type represents an IPv6 or host-based attack.booleanIndicates whether this failure type represents a path traversal attack.booleanIndicates whether this failure type represents a pattern-based detection.booleanIndicates whether this failure type represents a protocol violation.booleanIndicates whether this failure type represents a size or length violation.booleanIndicates whether this failure type represents a structural issue.static UrlSecurityFailureTypeReturns the enum constant of this class with the specified name.static UrlSecurityFailureType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INVALID_ENCODING
Invalid URL encoding sequences detected (e.g., incomplete percent encoding) -
DOUBLE_ENCODING
Double URL encoding patterns detected (e.g., %252e for double-encoded '.') -
UNICODE_NORMALIZATION_CHANGED
Unicode normalization changed the input, potentially bypassing security checks -
PATH_TRAVERSAL_DETECTED
Path traversal patterns like "../" or equivalent encodings detected -
DIRECTORY_ESCAPE_ATTEMPT
Attempt to escape from allowed directory structure detected -
INVALID_CHARACTER
Invalid or dangerous characters found in URL -
NULL_BYTE_INJECTION
Null byte injection attack detected (e.g., ) -
CONTROL_CHARACTERS
Control characters that could manipulate processing detected -
PATH_TOO_LONG
Path exceeds configured maximum length limits -
INPUT_TOO_LONG
Input exceeds configured maximum length limits -
EXCESSIVE_NESTING
Excessive directory nesting depth detected -
SUSPICIOUS_PATTERN_DETECTED
Suspicious patterns that match attack signatures -
SUSPICIOUS_PARAMETER_NAME
Suspicious parameter name commonly used in attacks -
KNOWN_ATTACK_SIGNATURE
Known attack signatures from security databases -
MALFORMED_INPUT
Input structure is malformed or corrupted -
INVALID_STRUCTURE
Input structure violates expected format -
PROTOCOL_VIOLATION
General protocol specification violation -
RFC_VIOLATION
RFC specification violation (HTTP, URI, etc.) -
INVALID_IPV6_FORMAT
Invalid IPv6 address format detected -
MALFORMED_URL
Malformed URL structure detected -
INVALID_HOST_FORMAT
Invalid host format detected -
INVALID_URL_FORMAT
Invalid URL format detected
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getDescription
Returns the human-readable description of this failure type.- Returns:
- Description text suitable for logging and error reporting
-
isEncodingIssue
Indicates whether this failure type represents an encoding-related issue.- Returns:
- true if this is an encoding-related failure type
-
isPathTraversalAttack
Indicates whether this failure type represents a path traversal attack.- Returns:
- true if this is a path traversal-related failure type
-
isCharacterAttack
Indicates whether this failure type represents a character-based attack.- Returns:
- true if this is a character-based failure type
-
isSizeViolation
Indicates whether this failure type represents a size or length violation.- Returns:
- true if this is a size/length-related failure type
-
isPatternBased
Indicates whether this failure type represents a pattern-based detection.- Returns:
- true if this is a pattern-based failure type
-
isStructuralIssue
Indicates whether this failure type represents a structural issue.- Returns:
- true if this is a structural failure type
-
isProtocolViolation
Indicates whether this failure type represents a protocol violation.- Returns:
- true if this is a protocol-related failure type
-
isIPv6HostAttack
Indicates whether this failure type represents an IPv6 or host-based attack.- Returns:
- true if this is an IPv6/host-related failure type
-