security(CASA-36): implement HPP testing and validation #1041
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CASA-36: HTTP Parameter Pollution (HPP) Testing and Validation
Overview
Implements comprehensive HTTP Parameter Pollution (HPP) testing and documentation to demonstrate Airweave's built-in FastAPI/Pydantic defenses for CASA compliance auditors.
Changes
Integration Tests (
backend/tests/integration/api/test_hpp_security.py)Security Documentation (
backend/docs/security/hpp-protection.md)API Security Hardening (
backend/airweave/api/v1/endpoints/collections.py)ge=0validation toskipparameterTesting
cd backend pytest tests/integration/api/test_hpp_security.py -vResults: ✅ 11/11 tests passing
CASA Compliance
Demonstrates that FastAPI's strict type validation provides comprehensive HPP protection across all parameter sources (query, path, headers, body). Duplicate parameters use last value with type enforcement, triggering 422 errors before reaching business logic.
Auditor Documentation
See
backend/docs/security/hpp-protection.mdfor complete technical details andbackend/tests/integration/api/test_hpp_security.pyfor test coverage.Summary by cubic
Hardened API against HTTP Parameter Pollution (CASA-36) by enforcing strict pagination parameter validation and adding integration tests that confirm FastAPI/Pydantic block polluted inputs before business logic. Prevents negative OFFSET errors and closes gaps in query/body validation.