Symfony 5.4

Last reviewed Oct 16, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. PHP 8.4128 lines · 4.4K tokens
  2. Symfony 5.496 lines · 5.9K tokens
Total224 lines · 10.3K tokens

CWE Coverage

  • 20
  • 22
  • 59
  • 78
  • 79
  • 88
  • 89
  • 93
  • 95
  • 98
  • 117
  • 187
  • 201
  • 203
  • 208
  • 209
  • 214
  • 256
  • 287
  • 294
  • 295
  • 307
  • 321
  • 323
  • 338
  • 340
  • 352
  • 354
  • 362
  • 367
  • 384
  • 390
  • 409
  • 434
  • 470
  • 488
  • 502
  • 522
  • 524
  • 532
  • 552
  • 601
  • 611
  • 613
  • 614
  • 639
  • 674
  • 732
  • 770
  • 776
  • 798
  • 807
  • 829
  • 862
  • 863
  • 915
  • 916
  • 918
  • 940
  • 942
  • 1004
  • 1275
  • 1333
  • 1336
  • 1395

Prompt Preview

Apply these rules when writing or reviewing Symfony 5.4 applications on PHP 8.4, after the included PHP baseline. Apply component-specific rules wherever those components are installed.

Version scope and deployment

  • Plan migration before this line's security support ends in February 2029; its regular bug-fix support has already ended.
  • Audit the resolved Composer packages, including Twig and optional bundles, with symfony check:security. Symfony doesn't tag every component in every patch release, so split packages such as symfony/http-client, symfony/security-http, and symfony/runtime carry their own patch numbers; update every installed symfony/* package together with composer update "symfony/*" and check each one against Symfony's advisories by its own version, not the framework's.
  • Set APP_ENV=prod and APP_DEBUG=0 for the web runtime, console deployment commands, cache warmup, and workers. Disable register_argc_argv in the web SAPI and keep the Runtime component patched; production flags must come from deployment configuration.
  • Serve only public/ as the document root, route application requests through public/index.php, and exclude development bundles from production. Limit runtime write access to required storage such as var/cache/, var/log/, and the upload store.

Requests, forms, and deserialization

  • Read input from the intended Request bag, such as query, request, or files; use Request::toArray() for JSON and handle decoding failures. Apply Validator constraints to the resulting values or DTOs before use; bag