Commit Graph

17 Commits

Author SHA1 Message Date
Mike German bb79146c68 fix(fetch_url): block cloud-metadata via IPv4-mapped IPv6 in SSRF guard
The fetch_url SSRF guard guarantees cloud-metadata endpoints (e.g.
169.254.169.254) are ALWAYS blocked, even when CAI_FETCH_ALLOW_INTERNAL
is set for an authorised internal pentest. That guarantee could be
bypassed with the IPv4-mapped IPv6 form of the IMDS address, e.g.
http://[::ffff:169.254.169.254]/ (or its hex form ::ffff:a9fe:a9fe),
because the metadata block is a plain string comparison against the bare
IPv4 literal. With allow_internal=True the private/reserved check is
skipped, so nothing caught the mapped form and the request reached IMDS.

Unwrap IPv4-mapped IPv6 addresses to their embedded IPv4 before the
metadata and private-range checks in both the literal-IP and DNS-resolved
paths. This also hardens the private-range check on Python versions that
do not classify mapped addresses as private/link-local.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Mike German <mike@stepsventures.com>
2026-07-06 21:31:06 -04:00
UnaiAlias 1c79507140
CAI 1.1.5 release (#455) 2026-06-05 13:43:19 +02:00
Ameer Pornillos 5d892a9267 Added additional prompt injections PoCs 15 and 16 (#276)
* Added prompt injections PoCs

* Mitigate PoCs 15 and 16

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>

---------

Signed-off-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
Co-authored-by: Víctor Mayoral Vilches <v.mayoralv@gmail.com>
2025-10-08 16:23:59 +02:00
luijait 82d0121bd8 async sessions + friendly IDs + tolerant session commands (#253)
* Manual port: async sessions + friendly IDs + tolerant session commands over origin/main; add tests for interactive sessions; no push

* Add guardrail tests

---------

Co-authored-by: System Administrator <root@MacBook-Air-de-luijait.local>
2025-08-29 15:34:48 +02:00
Víctor Mayoral Vilches 04359a07f3 Revert "Apply code formatting with make format" 2025-06-14 09:51:19 +00:00
luijait ba17d16d11 Fix generc linux command test 2025-05-27 12:39:00 +02:00
luijait 9af18a6e34 Add testg 2025-05-26 08:43:15 +00:00
luijait c69c4bcdbd Test 2025-05-25 14:27:59 +00:00
lidia9 483591f36a adding fake openai api key 2025-04-30 12:35:40 +02:00
lidia9 8c1dea4697 remove set disable in test 2025-04-30 11:41:40 +02:00
Mery-Sanz 957539880e tracing disabled 2025-04-30 11:37:06 +02:00
Mery-Sanz 5cd571976a fix pipleines 2025-04-11 12:24:32 +02:00
Mery-Sanz f07059cbd5 fix some test 2025-04-11 08:04:19 +02:00
Mery-Sanz 7e3af1842a add coments and docstring 2025-04-10 09:57:35 +02:00
Mery-Sanz 75869265a5 add more test 2025-04-10 09:27:56 +02:00
Mery-Sanz 9532fe42f5 add new test and fix previous 2025-04-10 08:54:21 +02:00
Mery-Sanz 8a2778769d add test 2025-04-10 07:58:40 +02:00