DNS Rebind SSRF in Discord Integration
As part of https://gitlab.com/gitlab-com/gl-security/engineering/issues/292 it was determined that Slack Notifications are vulnerable to a DNS rebind attack. This type of attack allows an attacker to bypass our SSRF protections by returning a valid IP address during validation, and a restricted/protected address when the actual connection is made.
Steps to Reproduce
- Setup a netcat listener on port 2345 of the GitLab server
- Input as the Webhook
Test setting and save changes
- Look for connection in netcat listener
- If a connection is not seen or error received, revisit configuration page and save again. Multiple attempts are sometimes needed to trigger attack.
SSRF protections are bypassed to make connections to internal services. The immediate impact seen is that an attacker can create network connections to internal system.
- The primary mitigation here would be to use a whitelist to only allow URLs containing
There is additional discussion happening around using a dns cacher with minimum TTL requirements DNS TTL. This would be considered a defense-in-depth measure.