Skip to content
RCE Disclosed report Advanced

Unauthenticated remote code execution on psg.gsfc.nasa.gov via arbitrary file write from a stack overflow in the PSG continuum module (SURFACE-TYPE)

An unauthenticated stack buffer overflow in PSG's continuum module allows an attacker to control a file path and appended content, enabling arbitrary file write. By targeting the web-executable graphs/ directory, a single anonymous POST can drop a persistent PHP web shell, achieving remote code execution as the web-server user.

metantz Follow

Originally disclosed on Bugcrowd

Critical View original
  • Fixed in 12 days
  • Disclosed after 13 days

Summary by metantz

An unauthenticated stack buffer overflow in PSG's native continuum module: the <SURFACE-TYPE> value from the public API is copied by unbounded strncpy into 50-byte stack buffers, overflowing into the adjacent filelog path buffer. By ending the copy at the original path's NUL terminator, an attacker controls both the file path and the appended content (<SURFACE-SURF>, written verbatim with no check on flog), turning the overflow into a silent arbitrary file write. Pointing it at the web-executable, runtime-writable graphs/ web root allows a single anonymous POST to drop a persistent PHP web shell — unauthenticated remote code execution as the web-server user, with no crash and an empty session log. Root cause: missing length/charset validation on the token, plus the unchecked flog before fprintf.

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

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

How it worked

Root cause

Likely missing length and character validation on the SURFACE-TYPE token, combined with an unchecked file path variable (flog) before writing.

Impact

An unauthenticated attacker could write arbitrary files and execute code as the web-server user, with no crash and an empty session log.

What the attacker needed

No authentication required; access to the public API

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

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

A program on a public NASA server copied a user-supplied value into a fixed-size memory box without checking its length. The extra data spilled into a nearby box that held a file path, letting the attacker choose where a file was written. Because the chosen folder was served by the web server and could run PHP scripts, the attacker could upload a small program and run commands on the server.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More from National Aeronautics and Space Administration (NASA) - Vulnerability Disclosure Program

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.