DALT.PHP

Challenges

Debug real bugs and learn by fixing them

Challenges

Fix intentionally broken code to understand how backend systems work.

Available Challenges

Route

Broken Routing

Fix route order and registration issues. Difficulty: Beginner

Shield

Broken Middleware

Fix authentication and CSRF validation bugs. Difficulty: Medium

Lock

Broken Authentication

Fix password verification vulnerability. Difficulty: Easy

Database

Broken Database

Fix SQL injection vulnerabilities. Difficulty: Medium

Clock

Broken Session

Fix flash data handling issues. Difficulty: Medium

Bug

Broken Full-Text Search

The search endpoint uses ILIKE — replace it with a tsvector full-text search. Difficulty: Medium

Bug

Broken JOIN

The posts endpoint uses the wrong JOIN type and wrong ON clause — fix both. Difficulty: Medium

Bug

Broken Transaction

The transfer endpoint has no ROLLBACK — a failed write corrupts the balance permanently. Difficulty: Medium

Bug

Broken First Queries

Fix three SQL bugs: injection, wrong column, and invalid response format Difficulty: Easy

Bug

Migration Disorder

The posts migration runs before the users migration, and uses SQLite syntax. Fix both. Difficulty: Medium

Bug

Missing JSONB Metadata

The posts controller ignores the metadata field — add it to the INSERT and SELECT. Difficulty: Medium

Bug

Missing Pagination

The users list endpoint dumps every row — add LIMIT and OFFSET to paginate it. Difficulty: Easy

Bug

Missing RLS Policy

A multi-tenant controller relies on PHP to filter data. Add Row-Level Security to enforce isolation at the database level. Difficulty: Hard

Bug

Slow Queries

Identify columns missing indexes based on controller queries and add them to the migration. Difficulty: Medium

Bug

Broken Nginx Config

Nginx isn't forwarding PHP requests to PHP-FPM — fix the config Difficulty: Easy

Bug

Missing Compose Services

The compose file only has the app service — add db and nginx Difficulty: Easy

Bug

Incomplete Dockerfile

Complete the Dockerfile for DALT.PHP — three parts are missing Difficulty: Easy

Bug

Missing Health Check

The app container boots before Postgres is ready. Add a healthcheck so depends_on can use condition: service_healthy. Difficulty: Easy

Bug

Missing Multi-Stage Build

Convert the single-stage Dockerfile to a multi-stage build and add a HEALTHCHECK. Difficulty: Medium

Bug

Plaintext Secrets

The Postgres password is hardcoded in the compose file — move it to a Docker secret. Difficulty: Medium

How Challenges Work

  1. Read the lesson - Understand the concept first
  2. Start the challenge - php artisan challenge:start <name> loads broken files
  3. Test the bug - See the broken behavior
  4. Debug and fix - Find and fix the issues
  5. Run verification - Check your solution automatically
  6. Review solution - Compare with the provided fix

Challenge Statistics

  • Total Challenges: 5
  • Total Bugs: 11
  • Estimated Time: 4-6 hours
  • Difficulty Range: Beginner to Medium

Ready to Start?

Begin with the first challenge or jump to any that interests you!

On this page