Skip to content

Commit 32c7bb9

Browse files
committed
fix wrong token error when saving links after metadata retrieval
- remove CSRF check from metadata endpoint to fix form token reuse - the XSRF token is single-use: `checkToken()` validates and destroys it. - the metadata XHR fires on page load, consuming the token rendered in the form - subsequent form submission then fails with 403. - the metadata endpoint is a read-only GET request, already protected against SSRF by scheme/IP/redirect validation. CSRF is unnecessary. - fixes #2242
1 parent e8a6539 commit 32c7bb9

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

application/front/controller/admin/MetadataController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ class MetadataController extends ShaarliAdminController
1717
*/
1818
public function ajaxRetrieveTitle(Request $request, Response $response): Response
1919
{
20-
$this->checkToken($request);
21-
2220
$url = $request->getParam('url');
2321

2422
// Only try to extract metadata from URL with exact HTTP(s) scheme

0 commit comments

Comments
 (0)