web
The last and hardest challenge of the comp I think
Exercise 15 is one specific challenge I would love to write about, I thought it was quite creative. And i like it a lot. I just solved it in one sitting 20 minutes with no AI or whatever. Just pure understanding of the challenge and code it out. God bless. 🐧
RAG HIJACK
A company ships a RAG-backed “Security Policy Assistant.” Can you poison the knowledge base with your own doc and trick the system into revealing the hidden flag?
Skills noted by the lab: basic RAG, basic Python, Linux CLI (nmap, curl, vim/nano).
I didn't have the full picture but ultimately this is all about poisoning the instruction since we know where the contents are being "queried". And through that, manipulate the entire pipeline behavior.

As mentioned, would need to find the stack of what the services are.
nmap -p- localhost --open -T4 → HTTP on :5000 (UI) and Weaviate :8080.
Well, that confirms of what we need to do hehe. (class SecurityPolicy with content, category, vectorizer:"none" (so we provide vectors)). Okay now we can send our "payload" to the database with an instruction-stuffed doc whose vector equals the query "device security" (guaranteed highest choice)
You can also verify our retrieval path with this
your object shows up with distance ≈ 5.96e-08 (basically 0). Now go to the chat UI (web app service hosting at port 5000) ask: device security. The model will retrieves our poison chunk and prints the flag
AI{RAG_BUSTED}
Last updated