Symfony 6.4
Last reviewed Oct 16, 2026
Prompt Details
Prompt Composition
2prompts
- PHP 8.4128 lines · 4.4K tokens
- Symfony 6.497 lines · 5.5K tokens
Total225 lines · 10K 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
- 345
- 347
- 352
- 354
- 362
- 367
- 384
- 390
- 409
- 434
- 470
- 488
- 502
- 522
- 524
- 532
- 552
- 601
- 611
- 613
- 614
- 639
- 674
- 732
- 755
- 770
- 776
- 798
- 807
- 829
- 862
- 863
- 915
- 916
- 918
- 940
- 942
- 1004
- 1275
- 1333
- 1336
- 1395
Prompt Preview
Apply the PHP 8.4 baseline first. These rules cover the Symfony 6.4 LTS line, which requires PHP 8.1 or later. Configure its security controls explicitly; several protections enabled by default in Symfony 7.0 are opt-in in 6.4. Read each release range below against the installed version of the component that owns the API, such as symfony/yaml or symfony/http-foundation, because Symfony does not tag every component in every 6.4 patch release.
Request binding and validation
- Bind untrusted bodies with
#[MapRequestPayload]and query data with#[MapQueryString]into dedicated DTOs, never onto Doctrine entities; use#[MapQueryParameter]for individual scalar, array, or backed-enum arguments. - Set
#[MapRequestPayload(acceptFormat: 'json')]on JSON endpoints and give other endpoints an explicit format allowlist. Do not let a caller select Serializer YAML merely becausesymfony/yamlis installed; enforce body-byte and collection-size limits before mapping or collecting denormalization errors. - Remember the mismatched defaults in 6.4:
#[MapRequestPayload]answers a validation failure with 422 while#[MapQueryString]answers with 404; setvalidationFailedStatusCodeso a rejected query string is not reported as a missing resource. - Set
framework.http_method_overridetofalse; leaving it unset in 6.4 still resolves totrue, so a plain POST carrying_method=DELETEreaches destructive routes and controllers. Reject unwantedX-HTTP-Method-Overrideheaders separately, since this setting only disables the parameter override. - Declare form fields