Skip to content

Commit 04d5e16

Browse files
AngelFQCclaude
andauthored
Security: Remove exposed validation-token test endpoint
Refs GHSA-9g35-w847-rpp8 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 00eb082 commit 04d5e16

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

src/CoreBundle/Controller/ValidationTokenController.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Symfony\Component\HttpFoundation\RequestStack;
2020
use Symfony\Component\HttpFoundation\Response;
2121
use Symfony\Component\Routing\Attribute\Route;
22-
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
2322
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
2423

2524
#[Route('/validate')]
@@ -71,21 +70,6 @@ public function validate(string $type, string $hash): Response
7170
]);
7271
}
7372

74-
#[Route('/test/generate-token/{type}/{resourceId}', name: 'test_generate_token')]
75-
public function testGenerateToken(string $type, int $resourceId): Response
76-
{
77-
$typeId = $this->validationTokenHelper->getTypeId($type);
78-
$token = new ValidationToken($typeId, $resourceId);
79-
$this->tokenRepository->save($token, true);
80-
81-
$validationLink = $this->generateUrl('validate_token', [
82-
'type' => $type,
83-
'hash' => $token->getHash(),
84-
], UrlGeneratorInterface::ABSOLUTE_URL);
85-
86-
return new Response("Generated token: {$token->getHash()}<br>Validation link: <a href='{$validationLink}'>{$validationLink}</a>");
87-
}
88-
8973
/**
9074
* Processes the action associated with the given token type.
9175
*/

0 commit comments

Comments
 (0)