Junglewise Threat Intelligence

GUN path traversal in static file server

Severity: info · Published 2019-06-05

Technologies: Amark Gun.

Executive brief

GUN is a real-time decentralized database library used in Node.js applications. The built-in static file server had a path traversal vulnerability that allowed attackers to read arbitrary files outside the intended directory, including environment variables and cloud provider credentials. This affected most applications using GUN's default setup or serving files through its HTTP module.

Technical details

The vulnerability is a path traversal flaw (CWE-22) in the lib/serve.js static file server module included with GUN. The issue occurs when curl is invoked with the --path-as-is flag, which bypasses URL normalization and allows dot-dot-slash sequences to traverse parent directories. The vulnerability does not trigger via standard browsers or curl without the flag, limiting the practical attack surface to direct HTTP requests with crafted path traversal payloads. An attacker with network access to an affected GUN instance can read sensitive files including environment variables and cloud credentials. The fix was released in version 0.2019.416 and higher.

Affected products

  • amark GUN < 0.2019.416

Timeline

  • 2019-06-04: disclosed
  • 2019-06-04: patched: Fixed in version 0.2019.416

References