← All guides

SECURITY COLLECTION

PHP / Laravel
Secure coding collection

100

PHP-001SQL injection: concatenating query stringsBeginner →PHP-002User input in Eloquent whereRaw or DB::rawIntermediate →PHP-003Passing user-provided column names to orderByIntermediate →PHP-004Rendering user data with Blade {!! !!}Beginner →PHP-005Mass assignment: passing $request->all() directly to create or updateBeginner →PHP-006Missing CSRF protection on state-changing routesBeginner →PHP-007IDOR: missing resource ownership checksBeginner →PHP-008Storing passwords in plaintext or with fast hashesBeginner →PHP-009Direct string comparison instead of password_verifyBeginner →PHP-010Passing user input to unserialize()Advanced →PHP-011Hardcoding APP_KEY or exposing it in a public repositoryIntermediate →PHP-012Web-accessible .env file under the document rootBeginner →PHP-013APP_DEBUG=true in productionBeginner →PHP-014Trusting only uploaded file extension or MIME typeBeginner →PHP-015Allowing script execution in upload directoriesIntermediate →PHP-016Constructing file paths from user input (path traversal)Beginner →PHP-017Open redirect (redirect($request->input('next')))Beginner →PHP-018SSRF: server requests a user-specified URLAdvanced →PHP-019Concatenating user input into shell commandsBeginner →PHP-020eval() or dynamic code executionBeginner →PHP-021Object-injection gadget chains (advanced PHP deserialization)Advanced →PHP-022Mail header injection (newlines in recipients or subject)Intermediate →PHP-023Generating tokens or secrets with rand()/mt_rand()Beginner →PHP-024Not regenerating the session ID after login (session fixation)Intermediate →PHP-025No login rate limitingIntermediate →PHP-026Revealing account existence through login or password-recovery responsesBeginner →PHP-027Not fixing the algorithm during JWT verification (alg none or key confusion)Advanced →PHP-028Missing route middleware exposes unauthenticated administration functionsIntermediate →PHP-029Trusting client-supplied role valuesIntermediate →PHP-030URL input in Blade attributes (javascript: scheme)Intermediate →PHP-031XSS due to incorrect JSON response Content-TypeIntermediate →PHP-032CORS wildcard with credentials allowedIntermediate →PHP-033Missing security headers (CSP, HSTS, nosniff)Beginner →PHP-034Using $request->all() without input validationBeginner →PHP-035Loose validation rules (accepting foreign keys without exists)Intermediate →PHP-036Exposing exceptions or stack traces in user responsesBeginner →PHP-037Storing sensitive files on a public diskIntermediate →PHP-038Comparing tokens or hashes using === (timing attacks)Advanced →PHP-039Missing Secure, HttpOnly and SameSite cookie settingsIntermediate →PHP-040Incorrect cipher modes such as fixed IV or ECBAdvanced →PHP-041Storing sensitive data in plaintext in databases or logsIntermediate →PHP-042Logging passwords, tokens or personal data and log injectionIntermediate →PHP-043Check-then-act race condition for inventory or couponsAdvanced →PHP-044Checking a file's existence before using it (TOCTOU)Advanced →PHP-045Leaving outdated Composer packages in place (known vulnerabilities)Beginner →PHP-046Running end-of-life framework versions (Laravel 8 or earlier, etc.)Beginner →PHP-047Exposing the Ignition debugging tool in production leads to RCEAdvanced →PHP-048Exposing vendor test scripts (eval-stdin.php)Intermediate →PHP-049PHP-CGI argument injection (Windows)Advanced →PHP-050Allowing XML external entity parsing (XXE)Advanced →PHP-051Missing scope in route model bindingIntermediate →PHP-052Sensitive operations through unsigned public URLsIntermediate →PHP-053Reusing or storing password-reset tokens in plaintextAdvanced →PHP-054Trusting two-factor authentication status solely through the sessionAdvanced →PHP-055Flawed "remember me" token designIntermediate →PHP-056Storing API tokens in plaintextIntermediate →PHP-057Exposing entire models in API responses, including sensitive attributesIntermediate →PHP-058Resource exhaustion through APIs without rate limits (DoS)Intermediate →PHP-059Regular expression ReDoS (catastrophic backtracking)Advanced →PHP-060Long-term exposure of public storage URLs (Storage::url)Intermediate →PHP-061Serializing sensitive information into queue-job payloadsAdvanced →PHP-062Unserializing queue or cache payloads from trusted storageAdvanced →PHP-063User input in cache keys (cache-key collision or injection)Intermediate →PHP-064PHP loose comparison (==) and type jugglingBeginner →PHP-065Not using strict mode in in_array()Beginner →PHP-066Bypassing extension checks with a null byte (%00)Advanced →PHP-067Trusting the Host header (password-reset link poisoning)Intermediate →PHP-068Using untrusted proxy headers (X-Forwarded-For)Intermediate →PHP-069Trusting cookie values without signing or encryptionIntermediate →PHP-070Reflected XSS in redirect messagesIntermediate →PHP-071Stored XSS in Markdown or HTML input (missing sanitization)Advanced →PHP-072Serving uploaded SVG or HTML from the same originIntermediate →PHP-073Zip Slip: missing path checks during extractionAdvanced →PHP-074Deploying without a lock file; dependency confusionAdvanced →PHP-075Exposing configuration cache or environment variables (config:cache file)Intermediate →PHP-076Logging the entire request (Input::all), including passwordsIntermediate →PHP-077Artisan, Tinker or debug commands accessible in productionAdvanced →PHP-078Publicly exposed Telescope or Horizon dashboardsIntermediate →PHP-079Arbitrary file exposure through symlink following (public storage link)Intermediate →PHP-080Creating temporary files with fixed names in /tmp (symlink race)Advanced →PHP-081Using only uniqid() to create temporary filesAdvanced →PHP-082Secrets left as default values (env('APP_KEY', 'secret'))Beginner →PHP-083Hardcoded passwords or API keys in source codeBeginner →PHP-084Handling logout with GET (CSRF)Intermediate →PHP-085Clickjacking: allowing framingBeginner →PHP-086XSS in Blade @json or <script> contextsIntermediate →PHP-087FormRequest authorize() defaults to trueBeginner →PHP-088Missing array-input type validationBeginner →PHP-089N+1 or DoS through nested Eloquent relationship loadingIntermediate →PHP-090Unlimited page size (per_page)Beginner →PHP-091No limits on upload size or countBeginner →PHP-092XML Billion Laughs (entity expansion DoS)Advanced →PHP-093Allowing object tags in a YAML parser (Symfony YAML)Advanced →PHP-094Interpreting arbitrary tags when loading YAML (older libraries)Advanced →PHP-095LDAP injection: concatenating filter stringsIntermediate →PHP-096XPath injectionIntermediate →PHP-097HTTP header CRLF injection (response splitting)Intermediate →PHP-098Weak password policy and lack of awareness of bcrypt's 72-byte limitIntermediate →PHP-099Self-privilege escalation (allowing role changes through mass updates)Intermediate →PHP-100Including development dependencies and test files in production deploymentsBeginner →