the fix for this is to disable IMDSv1 (IMDSv2 exposes the same data but you need to do a PUT request to get a token first, and pass that token as a header in future requests, which makes it less likely to be exploited by this kind of SSRF) and add network level controls on the instance to prevent it from reaching IMDS (on both IPv4 and IPv6!) if you don't need it.
the web fetch skill implementation should probably also check redirect URLs against a denylist and float redirects back into context
Holy fuck. That seems, erm ++ungood.
@Petesmom AWS (the cloud host) has a special service called IMDS that, among other things, provides methods of sharing secrets with servers. it's just a web API, you make requests to it and it returns data. when a server running in AWS asks IMDS for secrets, IMDS looks at that incoming request and goes "oh that's coming from server 12345, cool, give it access to the secrets for server 12345".
but if the LLM can make web requests, and the web requests come from that server... oops!
fun times with https://www.man7.org/linux/man-pages/man3/inet.3.html
169.254.169.254 can also be -
2852039166
0xA9FEA9FE
a9.fe.a9.fe
or
251.376.251.376
just incase someone tried to be clever and prohibit queries about 169.254 addresses
I did forget that you can mix and match... I love inet(3)
I do not understand. Boosting anyways. Someone might need a little chaosing...
@[email protected] LLMs often get given the ability to download webpages, e.g. you say "look at [URL]" and that runs a script that downloads the URL and returns the results back to the LLM (and, in turn, possibly to you). if the LLM itself is running on a server, such as it would be for something like those awful support chat bots, then the request comes from the server, not your computer.
Many thanks appreciate the info. Not for me but glad I boosted :-)