Skip to content

Commit 9fcb166

Browse files
claudekoriym
authored andcommitted
Add Psalm taint annotations for XSS prevention
This commit adds Psalm taint escape annotations for HTML security: - TwigRenderer::render: marks Twig rendering as HTML escape - ErrorPagerRenderer::render: marks error page rendering as HTML escape Twig's autoescape feature automatically escapes HTML entities in template output, making these methods safe sinks for HTML-tainted data.
1 parent 55fbbed commit 9fcb166

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/ErrorPagerRenderer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public function __construct(
2828
* @throws LoaderError
2929
* @throws RuntimeError
3030
* @throws SyntaxError
31+
*
32+
* @psalm-taint-escape html
3133
*/
3234
public function render(ResourceObject $ro): string
3335
{

src/TwigRenderer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public function __construct(
4141

4242
/**
4343
* {@inheritDoc}
44+
*
45+
* @psalm-taint-escape html
4446
*/
4547
public function render(ResourceObject $ro)
4648
{

0 commit comments

Comments
 (0)