PHP framework-specific security audit
Framework identification decision table
| Identification characteristics |
Framework |
In-depth reference |
composer.json → laravel/framework |
Laravel |
references/laravel-patterns.md |
composer.json → topthink/framework |
ThinkPHP |
references/thinkphp-patterns.md |
Existence of wp-content/ directory or wp-config.php |
WordPress |
references/wordpress-patterns.md |
composer.json → symfony/framework-bundle |
Symfony |
This article briefly covers |
composer.json → yiisoft/yii2 |
Yii2 |
This article briefly covers |
composer.json → codeigniter4/framework |
CodeIgniter |
This article briefly covers |
Laravel core checkpoints
- Mass Assignment --
$fillable / $guarded whether it is correctly configured,Model::create($request->all()) or update($request->all()) whether there are unfiltered fields
- Blade XSS -- search
{!! !!} unescaped output,@php direct echo within directives, custom Blade Directive not calling e()
- CSRF exceptions --
VerifyCsrfToken whether the middleware $except array contains sensitive routes, API route groups by default do not include the CSRF middleware
- Gate / Policy -- whether controller methods call
$this->authorize() or Gate::allows(), whether Policy definitions cover all CRUD
- Eloquent Raw --
whereRaw / havingRaw / orderByRaw / DB::raw whether variable concatenation exists in
- Signed URL / Debug --
APP_DEBUG=true remnants,.env Web-accessible, Telescope / Debugbar route exposure
ThinkPHP core checkpoints
- Historical RCE routes -- TP5.x
method() coverage,Request class __construct arbitrary method invocation
- Cache file writing -- cache file path predictable + content controllable → write WebShell
- Database where injection --
where in array conditions exp / like / between expression injection,Db::raw
- Session deserialization -- TP6 session serialization driver may trigger POP chains
- Template injection --
{php} tags, variable functions {:system()}
WordPress core checkpoints
- Plugin action/filter --
wp_ajax_nopriv_* hooks expose unauthenticated operations, Shortcode callback parameter injection
- Missing $wpdb->prepare -- directly concatenating SQL into
$wpdb->query()
- nonce verification -- form handling / AJAX handler lacks
wp_verify_nonce / check_admin_referer
- REST API --
register_rest_route the permission_callback whether it is __return_true or missing
- File upload -- plugin custom upload logic bypasses
wp_handle_upload the MIME check
Symfony brief overview
- Debug mode --
APP_DEBUG=1 leaks Profiler / Web Debug Toolbar, exposing environment variables and SQL
- YAML deserialization -- lower versions
Yaml::parse support !!php/object tags leading to object injection
- Security Voter -- custom Voter logic flaws or
ACCESS_ABSTAIN misuse leading to privilege escalation
Yii2 brief overview
- RBAC configuration --
DbManager improper permission assignment,checkAccess missing calls leading to vertical privilege escalation
- ActiveRecord injection --
findBySql / where condition string concatenation,orderBy unfiltered
CodeIgniter brief overview
- Global XSS filtering -- CI3
$config['global_xss_filtering'] is deprecated, CI4 requires manual invocation of esc()
- CSRF Token -- configuration
CSRFProtection but too many routes are excluded, improper Token regeneration strategy
In-depth Reference