Repository navigation
Disable unauthenticated remote FILE: read command in radium/argus out… - #37
Merged
Merged
Conversation
…put server
ArgusCheckClientMessage()'s RADIUM_FILE command handler let any client
connected to a running radium (or 'argus -B') output server request an
arbitrary local file by sending 'FILE:<path>' over the client
connection. The path came directly from client-supplied network input
("char *file = &ptr[6];") with no validation, and was passed unmodified
into ArgusSendFile(), which stat()s and fopen()s it and streams its
contents back to the client -- readable by whatever user the server
process runs as, with no authentication check gating this command and
no restriction on which paths could be requested.
Rather than build out proper access control (an opt-in configuration
option, path allow-listing, and/or requiring an authenticated session)
for a feature with no currently known caller relying on it, this
command is disabled outright:
- ArgusClientCommands[RADIUM_FILE] (the "FILE:" string radium matches
incoming client messages against) is set to NULL, so the command-
matching loop's own "ArgusClientCommands[i] != NULL" guard skips it
entirely -- a client sending "FILE:..." now falls through to the
generic unrecognized-command log path.
- The RADIUM_FILE case body (the call into ArgusSendFile()) is also
commented out, so restoring the NULL entry alone would not be
sufficient to re-enable this behavior; a deliberate code change is
required.
ArgusSendFile() itself and its declaration are left in place, unused,
since it is not otherwise reachable and removing it is out of scope
for this fix.
Verified via clean rebuild (0 errors), and a normal radium/ra
end-to-end regression test: radium serving a real argus data file
(derived from the RIMPAC baseline pcap) over a local TCP listener,
with an ra client connecting and successfully receiving the MAR
status header, confirming the ordinary client START/connection
lifecycle is unaffected by this change. The standard RIMPAC-pcap
smoke test (bin/ra -r ... -c ',') also confirmed unaffected (1825
records, unchanged). No FILE: exploitation attempt was made against
the pre-fix binary; the defect (unauthenticated arbitrary local file
read via a documented command dispatch table) is unambiguous from
static inspection alone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…put server
ArgusCheckClientMessage()'s RADIUM_FILE command handler let any client connected to a running radium (or 'argus -B') output server request an arbitrary local file by sending 'FILE:' over the client connection. The path came directly from client-supplied network input ("char *file = &ptr[6];") with no validation, and was passed unmodified into ArgusSendFile(), which stat()s and fopen()s it and streams its contents back to the client -- readable by whatever user the server process runs as, with no authentication check gating this command and no restriction on which paths could be requested.
Rather than build out proper access control (an opt-in configuration option, path allow-listing, and/or requiring an authenticated session) for a feature with no currently known caller relying on it, this command is disabled outright:
ArgusSendFile() itself and its declaration are left in place, unused, since it is not otherwise reachable and removing it is out of scope for this fix.
Verified via clean rebuild (0 errors), and a normal radium/ra end-to-end regression test: radium serving a real argus data file (derived from the RIMPAC baseline pcap) over a local TCP listener, with an ra client connecting and successfully receiving the MAR status header, confirming the ordinary client START/connection lifecycle is unaffected by this change. The standard RIMPAC-pcap smoke test (bin/ra -r ... -c ',') also confirmed unaffected (1825 records, unchanged). No FILE: exploitation attempt was made against the pre-fix binary; the defect (unauthenticated arbitrary local file read via a documented command dispatch table) is unambiguous from static inspection alone.