Summary
There is SSRF via the upload image from url api.
Details
Users that can use the /Attachment/fromImageUrl can specify URL to point to an internal host. Even though there is check for content type, it can be bypassed by redirects in some cases.
PoC
Login as a user who can access attachments APIs, with credentials, make a post request to /api/v1/Attachment/fromImageUrl
with the following data
{
"url": "http://localhost:8888",
"parentType": "Note",
"field": "attachments"
}
On server side, listen on localhost:8888 and it will receive a request, which normally shouldn't be accessible from outside.
To bypass content type check, use a redirect, for example, by using https://ssrf.localdomain.pw/img-with-body/301-http-127.0.0.1:8888-.i.jpg as url, which spoofs the content type, and the actual response will be saved as an attachment. Then by using the /api/v1/Attachment/file/id endpoint the response can be retrieved.
Impact
This SSRF can be leveraged to disclose internal information (in some cases), target internal hosts and bypass firewalls.
See here for more information on SSRF and here for fix strategies
Summary
There is SSRF via the upload image from url api.
Details
Users that can use the /Attachment/fromImageUrl can specify URL to point to an internal host. Even though there is check for content type, it can be bypassed by redirects in some cases.
PoC
Login as a user who can access attachments APIs, with credentials, make a post request to /api/v1/Attachment/fromImageUrl
with the following data
On server side, listen on
localhost:8888and it will receive a request, which normally shouldn't be accessible from outside.To bypass content type check, use a redirect, for example, by using
https://ssrf.localdomain.pw/img-with-body/301-http-127.0.0.1:8888-.i.jpgas url, which spoofs the content type, and the actual response will be saved as an attachment. Then by using the /api/v1/Attachment/file/id endpoint the response can be retrieved.Impact
This SSRF can be leveraged to disclose internal information (in some cases), target internal hosts and bypass firewalls.
See here for more information on SSRF and here for fix strategies