Laravel
Open-source PHP-based web framework for building web applications
The
MVC design patternseparates the application’s logic (Model) from the user interface (View), and defines clear responsibilities for handling user input (Controller).Uses
Eloquent ORMfor interacting with the database, providing an elegant and secureActiveRecordimplementation (automatically escapes parameters in queries).
Authorization/Authentication
Offers
Passport full OAuth2server implementation.Sanctum: A simple way to authenticateSPAs(Single Page Applications) and mobile applications using simple token-based authentication.Uses
bcryptby default for hashing passwords.
Session Management
Automatically generates a
CSRFtoken for every active user session.
The
session IDis typically stored in the user's browser under acookielikelaravel_session.
The
cookiesshould haveHttpOnlyenabled. Check it atconfig/session.php:
'secure' => env('SESSION_SECURE_COOKIE', null),
'http_only' => true,Modify session data and investigate the requests to know the type of
driverbeing used by the application.
Session Drivers
Session Drivers File: Default Driver.
Ensure that the session files aren't in a location that is not publicly accessible. (
storage/framework/sessions).
Database: Normally use it when persistence across multiple servers is needed
Check the session table access control and database's connections.
Redis: Normally use when the application needs high-performance.
Ensure that is properly configured
Cookie: Session data is stored directly in a cookie in the client-side
Check the cookie is not storing sensitive data.
When the session expires. Check that the session data and the client’s cookie have been removed or invalidated.
Encryption
Support
AES-256-CBCencryption.Uses an
APIfor encrypting and decrypting data with automatic key management.
Enumeration
Tools: Laravel Security and Laravel Auditing.
Check if
.env,storage/are publicly accessible.In the
.envfile; CheckAPP_DEBUG=false.
Ensure that
Debugbaris not enabled.
Check if the application validate the
URLduring redirects.
Check all
form'sCSRFtokens.
Check that model's properties properly handle mass assignment. (
$fillableor$guardedon Eloquent models).
IDOR: Check validation on user input for model binding in routes:
Route::get('user/{id}', ...)Last updated