Vulnerability DatabaseCVE-2016-1000305

CVE-2016-1000305
Ruby vulnerability analysis and mitigation

Overview

CVE-2016-1000305 is a directory traversal vulnerability in the guard-livereload Ruby gem that allows remote attackers to read arbitrary files on the server by exploiting improper path validation in the livereload WebSocket server functionality. It affects all versions of guard-livereload before 2.5.2, and was originally discovered and reported on February 4, 2016, with the CVE identifier assigned by the DWF (Distributed Weakness Filing) project. The vulnerability was formally published to the GitHub Advisory Database in July 2026 under GHSA-g65v-27r3-5p6m. It carries a CVSS v4.0 base score of 6.9 (Medium) and a CVSS v3 score of 5.3 (Medium) (GitHub Advisory, Ruby Advisory DB).

Technical details

The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory — Path Traversal), where the _serve method in lib/guard/livereload/websocket.rb failed to sanitize file paths before serving them over the livereload WebSocket socket (default port 35729). An attacker could send a specially crafted HTTP GET request to the livereload socket with a path such as ./../../etc/passwd, which the server would expand to ../../../etc/passwd and serve the contents of any user-readable file to the requester — no authentication required. The fix (commit 0e98469) changed the behavior so that requests for any file other than ./livereload.js now return a 403 Forbidden response instead of serving the file (GitHub PR #158, GitHub Advisory).

Impact

Successful exploitation allows any attacker who can reach the livereload WebSocket port to read arbitrary files accessible to the user running the livereload server process, including sensitive files such as /etc/passwd, application configuration files, private keys, or credentials. There is no impact on integrity or availability, but the confidentiality risk is significant in multi-user server environments or when the WebSocket port is exposed beyond localhost. The vulnerability is particularly dangerous when the livereload socket is bound to a non-local address or when the port is forwarded to untrusted or multi-user remote machines (GitHub Issue #159, GitHub Advisory).

Exploitation steps

  1. Reconnaissance: Identify servers running guard-livereload (versions < 2.5.2) with the livereload WebSocket port (default: 35729) accessible — either directly on the network, via localhost, or through port forwarding.
  2. Connect to the livereload socket: Use a tool such as curl, netcat, or a WebSocket client to connect to the target's livereload socket (e.g., http://target:35729/).
  3. Craft a path traversal request: Send a specially crafted HTTP GET request with a traversal payload in the path, for example:
    GET ./../../etc/passwd HTTP/1.1
    Host: target:35729
    The leading ./ causes the path to be expanded by the server to ../../../etc/passwd.
  4. Receive file contents: The vulnerable server serves the contents of the requested file (e.g., /etc/passwd) directly over the socket, exposing sensitive data to the attacker (GitHub PR #158, GitHub Issue #159).

Indicators of compromise

  • Network: Unexpected HTTP GET requests to port 35729 (livereload default) containing path traversal sequences such as ./../../, ../, or encoded variants; connections to the livereload port from untrusted or external IP addresses.
  • Logs: Web server or application logs showing GET requests to the livereload socket with unusual path components (e.g., ./../../etc/passwd, ./../../home/user/.ssh/id_rsa).
  • Process: The Ruby process running guard-livereload reading files outside the project/web root directory, observable via system call tracing (e.g., strace, auditd file access logs).

Mitigation and workarounds

Upgrade guard-livereload to version 2.5.2 or later, which restricts file serving over the WebSocket socket to only ./livereload.js and returns a 403 Forbidden for all other file requests. As a workaround, ensure the livereload WebSocket port (default: 35729) is bound only to localhost (127.0.0.1) and is not exposed to untrusted networks or forwarded to remote machines. The Ruby Advisory DB notes that the gem may not have been re-released after the fix, and recommends considering migration to rack-livereload as an alternative (GitHub Advisory, Ruby Advisory DB).

Additional resources


SourceThis report was generated using AI

Related Ruby vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2016-1000305MEDIUM6.9
  • Ruby logoRuby
  • guard-livereload
NoYesJul 31, 2026
CVE-2026-45377MEDIUM6.5
  • Ruby logoRuby
  • decidim-core
NoYesJul 31, 2026
CVE-2026-45376MEDIUM5.5
  • Ruby logoRuby
  • decidim-admin
NoYesJul 31, 2026
CVE-2026-45086MEDIUM5.4
  • Ruby logoRuby
  • decidim-demographics
NoYesJul 31, 2026
CVE-2026-45330MEDIUM4.9
  • Ruby logoRuby
  • decidim-verifications
NoYesJul 31, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management