matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: Plugin HTTP has no SSRF protection

Open andrinoff opened this issue 7 months ago • 2 comments

Describe the bug

plugin/http.go validates URL scheme (only allows http:// and https://) but does not block requests to private/internal IP ranges. A malicious or poorly-written plugin could:

  • Probe the local network (127.0.0.1, 10.x, 192.168.x)
  • Access cloud metadata endpoints (169.254.169.254)
  • Hit internal services on localhost

To reproduce

  1. Install a plugin that calls matcha.http({url = "http://169.254.169.254/latest/meta-data/"})
  2. The request succeeds and returns cloud instance metadata

Expected behavior

Requests to private IP ranges (RFC 1918), loopback (127.0.0.0/8), link-local (169.254.0.0/16), and other non-routable addresses should be blocked by default. Consider using a custom http.Transport with a DialContext that validates the resolved IP before connecting.

OS

All platforms

andrinoff avatar Apr 15 '26 19:04 andrinoff

This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.

floatpanebot avatar May 16 '26 05:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar May 30 '26 05:05 floatpanebot