-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arbitrary File Write End User Device (Marti API) (Remote Code Execution) #293
Comments
fixed in 1.9.8.5 |
We will reopen it, but as described before, this is a minor issue, compared to the fact that anyone with access to the network can do real damage. |
Agreed that the server should run behind a Zerotier network, and preferably with SSL to protect the users etc. Though even if this is tested on the non SSL port, the vulnerability is still present regardless of SSL or not! |
Not correct. The standard deployment has the service shutdown so the port
is not there
…On Sat., Mar. 12, 2022, 6:03 p.m. Christoffer Claesson, < ***@***.***> wrote:
Agreed that the server should run behind a Zerotier network, and
preferably with SSL to protect the users etc. Though even if this is tested
on the *non* SSL port, the vulnerability is still present regardless of
SSL or not!
And while everyone should be trusted on the network, it is not a good
situation when, even a trusted user, can take over the infrastructure
through these kind of vulnerabilities!
—
Reply to this email directly, view it on GitHub
<#293 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOPIAPKWHFZ34AMR2CP5SI3U7UIEXANCNFSM5ORCSNGA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Since the SSL DP Service uses the same API call it is still vulnerable! I just used the TCP DP port for brevity's sake as you can make simple PoCs so whatever you sanitize on the TCP will still work for the SSL! |
@Securitybits-io the SSL DP service now requires a valid certs |
I mean, will there be a patch in 1.9.9 for input sanitization? You can make some assumptions regarding the data that is sent to the server for that API endpoint and construct some conditional statements in order to break and return a '50# Invalid file sent' much like you did for the hash argument. For example you know that
This is generally a good requirement to have on all endpoints which a user can control the input on! |
@Securitybits-io working on applying these fixes, just doing a review of all user input locations so that it's not whack-a-mole with issues |
before this can be closed we need to establish a sustainable and tested fix for the filename serialization and probably user input validation in general, any input would be appreciated |
closing for now, because we got no further input |
End User Device MissionUpload
This attack is done through the Marti RestAPI which is specific to EUDs,
which have been abused over the
TCP/8080
or the SSL equivalent (Given a valid user certificate)TCP/8443
.The difference between the WebUI way and the Marti way is that it does not add junk at the end of the file, as the EUDs are responsible for creating valid DataPackages.
Function Sourcecode:
Whats visible in the vulnerable code block is that the parameter
filename
is passed toos.path.join((str(directory), filename))
which when supplied alot of../
(8 to be exact) it puts the base directory at the root of the filesystem and then the file is put wherever its directed (given write permissions)Proof of Concept
Sending the file contents to the missionupload endpoint results in a valid response and browsing to the file on the WebUI results in Code Execution:
The file will be uploaded to
/usr/local/lib/python3.8/dist-packages/FreeTAKServer-UI/app/home/templates
which is where the Flask server is hosting its files from.The text was updated successfully, but these errors were encountered: