A comprehensive open-ended static analysis tool for discovering Host Header usage patterns in PHP frameworks.
This tool performs Open Taint Tracking analysis to discover all Host Header usage patterns in PHP frameworks without any sink restrictions. It provides comprehensive insights into how host data flows through the codebase.
- Open-ended Taint Tracking: No sink restrictions, let taint flow freely
- Comprehensive Discovery: Find all host usage patterns, not just security issues
- Pattern Classification: Categorize usage into 8 different types
- Security Analysis: Identify validation, risk usage, and context-dependent cases
- 33 taint propagation points discovered
- 12 files analyzed
- 6 usage patterns identified:
- URL Construction: 15 (45.5%)
- Other: 9 (27.3%)
- Direct Return: 4 (12.1%)
- Object Properties: 3 (9.1%)
- Validation: 1 (3.0%)
- String Operations: 1 (3.0%)
- Security Analysis:
- Explicit validation: 4 points
- No explicit validation: 10 points
- Context-dependent: 19 points
python3 open_taint_analyzer.pypython3 open_taint_analyzer.py --framework 1- Laravel
- Symfony
- WordPress
- CodeIgniter
- CakePHP
- Yii2
- All Frameworks
├── open_taint_analyzer.py # Main analysis tool
├── rules/
│ ├── discovery/
│ │ └── open-host-exploration.yml # Open exploration rule
│ └── psalm-stubs/
│ ├── taint_sources.phpstub # Taint sources
│ └── open_exploration.phpstub # Open exploration stubs
├── frameworks/ # Framework source code
└── results/ # Analysis results
└── [framework]/
├── open_discovery.json # Raw discovery data
├── open_taint_data.csv # Structured analysis data
├── open_analysis_summary.json # Analysis summary
└── call_graph/
└── host_call_graph.json # Host call graphs & program slices
- open_discovery.json: Raw Semgrep discovery results
- open_taint_data.csv: Structured analysis data with usage patterns
- open_analysis_summary.json: Analysis summary with statistics
- call_graph/host_call_graph.json: Enriched call graphs with per-finding slices, callers, and risk annotations
- No Sink Restrictions: Discovers all host usage patterns
- Pattern Classification: 8 different usage pattern types
- Security Analysis: Validation and risk assessment
- Comprehensive Coverage: 175% more findings than restrictive methods
- Framework Support: Laravel, Symfony, WordPress, CodeIgniter, CakePHP, Yii2
- Call Graph Insights: Automatic extraction of host-related call chains and contextual slices per finding
- Direct_Return: Direct return of host data
- URL_Construction: Host data used in URL building
- Header_Setting: Host data in HTTP headers
- Configuration: Host data in configuration
- Validation: Host data in validation logic
- String_Operations: Host data in string manipulation
- Object_Properties: Host data assigned to object properties
- Other: Other usage patterns
- Comprehensive Discovery: Find all host usage points
- Research Foundation: Understanding of framework behavior
- Security Insights: Identify validation and risk patterns
- Academic Value: Objective analysis without subjective risk assessments
- Python 3.6+
- Semgrep
- PHP frameworks in
frameworks/directory
OPEN TAINT TRACKING RESULTS FOR LARAVEL
============================================================
Total Taint Points: 33
Files Analyzed: 12
Analysis Type: Open Taint Tracking
Usage Pattern Distribution:
- URL_Construction: 15 (45.5%)
- Other: 9 (27.3%)
- Direct_Return: 4 (12.1%)
- Object_Properties: 3 (9.1%)
- Validation: 1 (3.0%)
- String_Operations: 1 (3.0%)
Security Analysis:
- Explicit validation: 4 points
- No explicit validation: 10 points
- Context-dependent: 19 points
This tool provides comprehensive open-ended analysis of Host Header usage in PHP frameworks, enabling researchers and developers to understand data flow patterns and security implications.