Skip to content

Instantly share code, notes, and snippets.

@lirantal
Created October 21, 2022 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lirantal/832382155e00da92bfd8bb3adea474eb to your computer and use it in GitHub Desktop.
Save lirantal/832382155e00da92bfd8bb3adea474eb to your computer and use it in GitHub Desktop.
Denial of Service in lite-server@2.6.1

Denial of Service vulnerability in lite-server@2.6.1

lite-server is a local HTTP file server, or as is it describes itself: Lightweight development node server for serving a web app, providing a fallback for browser history API, loading in the browser, and injecting scripts on the fly..

Observation:

  • It is quite popular with 30,346 weekly downloads for its latest version
  • It was last published 2 years ago

Resources:

Background on exploitation

If an attacker makes an HTTP request to a server running with lite-server and includes control characters that the decodeURI() function is unable to parse, then it causes lite-server to crash.

Proof of Concept exploit

  1. Run the server npx lite-server --baseDir="public/"
  2. Send an HTTP request which uses unicode characters outside of the ASCII scope of URLs: curl http://10.100.102.7:3000/..%c0%2fetc%c0%2fhosts
  3. Observe the server crashes

This is happening due to the fact that the logger that is used to print the information uses the decodeURI() function which throws an exception that is unhandled by the library code and propagated up to the Node.js runtime.

Author

Liran Tal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment