Day 12 of 2160 minShell WalkerHands-on lab
Day 12: Review: Sharing, Fetching and AI Features
Taught by Mr Elite Updated
By the end of today you can
- Test a chat share link for IDOR by enumerating predictable IDs in the lab
- Show that a guardrail inside an LLM does not replace a server-side network check in the lab
- Explain how a classic web bug looks when it reappears in an AI feature
- Extend your bug class table with an AI feature column
Warm-up
Answer from memory first, then tap to check. Recalling yesterday is what makes it stick.
Why is model output treated as untrusted input?
Users and documents can steer what the model writes, so anything it produces must be encoded or limited before use.
Why is a prompt instruction not a real security control?
It is only a request to the model. Encoding, sanitising and permissions are enforced by code and cannot be talked around.
Imagine a chat product with a Share button. You click it, get a link ending in a number, and send it to a colleague. Out of curiosity you change that number by one. A stranger's conversation appears. People paste contracts, passwords and medical worries into AI chats, so the impact is far worse than with an ordinary page.
Now imagine a second product, an agent that fetches web pages for you. It refuses to touch anything called localhost. Today you will see why that refusal is a polite request, not a wall. Both bugs are old friends from earlier days. Our job is to recognise them in new clothes.
Old bugs, new packaging
Nothing in AI products replaces the web underneath. A chat is still HTTP, sessions, IDs, and a server that fetches things. So the bugs you met on Day 7 (IDOR) and across the SSRF and injection work still apply. What changes is where the sensitive data sits and who is making the request.
- IDOR
- Insecure direct object reference. The server hands over an object because you asked for its ID, without checking you may see it.
- SSRF
- Server-side request forgery. You make the server send a request to somewhere you cannot reach yourself, such as an internal service.
- Agent tool
- A function, such as http_get, that a language model can call to act in the world. The code behind it runs on the server.
The review habit is simple. For any AI feature, ask two questions. Which object is being addressed by an ID, and who checks ownership? Which action is the server performing on my behalf, and who checks the destination? Those two questions find most of today's bugs.
Quick check
A chat app serves /share/4412 to anyone, whether or not that chat was shared. Which bug class is this?
The object is addressed directly by a guessable ID and the server does no ownership or sharing check.
Lab one: the share-link IDOR
The first lab is ai-chat-share-idor-1. ChatNova lets you share a conversation by link, but the share page serves any conversation by ID, shared or not, and the IDs are not random. Everything here runs inside the SecurityElites lab, so enumerating IDs is fine there and nowhere else.
Treat it as a Day 7 exercise with a new target. Create or find your own conversation first, share it, and study the URL. Your own object is your baseline. You know what it should look like, so you can tell when you are seeing someone else's.
Watch me do it: proving the IDOR with curl
I will show the method with placeholder values. Swap in your lab address and your own session cookie from the browser developer tools. Do not paste a real cookie into an AI assistant. You learned that on Day 2.
BASE="http://LAB-ADDRESS"
curl -s -o /dev/null -w "%{http_code}\n" "$BASE/share/1001"
for i in $(seq 1000 1010); do
printf "%s " "$i"
curl -s -o /dev/null -w "%{http_code} %{size_download}\n" "$BASE/share/$i"
doneQuick check
Your loop shows 200 for IDs 1000 to 1010 with different sizes. What is the best next step?
Different sizes suggest real content, but you verify by reading it before you make a claim.
Lab two: the agent that fetches for you
The second lab is ai-llm-ssrf-1. FetchBot has an http_get tool that retrieves URLs for users, and the tool runs server-side. The model has a guardrail that refuses URLs containing words like localhost, 127.0.0.1 or internal. The guardrail lives in the language model, not in the code that makes the request.
That distinction is the whole lesson. A filter that the model applies is a request to behave. A filter in the tool's code, checking the resolved address, is a control. Ask yourself what the server does with the URL after the model passes it on.
Hints for your attempt: read what the lab says about internal services first. Think about other ways to name the same machine that a word filter would not recognise. Remember Day 9 and Day 10, where wording and context moved the model. Ask for something harmless and read-only, and note exactly what you sent and what came back.
Mapping the bugs into your table
Now we consolidate. Open bug-class-table.md from earlier days. You have columns such as bug, where it lives, proof and fix. Add one called In an AI feature. Each cell should say what the bug looks like when an AI product carries it.
| Bug class | Classic form | In an AI feature | Control that fixes it |
|---|---|---|---|
| IDOR | /invoice?id=12 | /share/ID shows any chat | Ownership check per request |
| SSRF | url= parameter | Agent http_get tool | Server-side destination allowlist |Go through earlier rows too, including XSS and SQL from Day 11, and prompt injection. Ask for each one: what is the trust boundary, and where was its check missing? Fill every cell yourself first. You may then ask an assistant to critique the table, but check anything it adds before keeping it.
Your turn
AI Chat Share-Link IDOR
We start with the share-link lab because it is the most direct reuse of Day 7. The second lab, ai-llm-ssrf-1, is covered in the section above and is also part of today's mission. Both are SecurityElites practice labs, so testing is safe and allowed there.
What to try
What to notice
- Whether the share page checks that a chat was actually shared
- Whether IDs follow a pattern you can predict
- Whether the refusal in FetchBot comes from the model or from the tool code
- How much private data one request exposes
If it did not work
Claiming IDOR after seeing 200 responses without reading them
Open the responses. Confirm they contain other users' data, not a shared error page.
Treating a model's refusal as proof the server is protected
Test what happens when the model does pass the URL on. The control must sit in the tool code.
Pasting session cookies or private lab content into an assistant
Redact first, as on Day 2. Describe the shape of the data, not the secret.
Saving no evidence
Keep the exact request, status code and one harmless line of output for each lab.
Recap
- Web bugs reappear inside AI features because the HTTP layer underneath is unchanged
- Predictable IDs plus a missing ownership check give IDOR, and chat content makes it severe
- An agent's HTTP tool runs on the server, so it can reach places you cannot
- A guardrail in the model is a request, while an allowlist in code is a control
- Always ask which object is addressed and which destination is fetched, and who checks each
- Prove impact with the smallest harmless evidence and record it
Cheat sheet
curl -s -o /dev/null -w "%{http_code} %{size_download}\n" URL- Print only the status code and response size
seq 1000 1010- Generate a range of numbers for a loop
IDOR check- Does the server verify ownership for this ID?
SSRF check- Does the code validate the resolved destination?
Trust boundary- The point where untrusted input meets something sensitive
Before the next day
Mission: Two labs and an AI column
Solve both labs, record your evidence, and extend your bug class table so you can spot these bugs in future AI products. This turns two lab wins into a reusable habit.
About 35 min
You are done when: A day12 folder with two notes files and an updated bug-class-table.md with the new column
Want more? Write a short fix note for each lab: the exact server-side check that would have stopped it.
Quiz
4 questions. Your score is saved with your progress.
1. Why is a predictable ID in a share link a serious problem for an AI chat product?
Predictable IDs without an access check allow enumeration, and chats often contain private information.
2. FetchBot refuses URLs with the word localhost. What does this tell you?
A word filter in the model is a soft control. The real question is what the server-side tool does with the URL.
3. Which fix actually stops the agent SSRF?
Only an enforced check in code on the actual destination is reliable.
4. What is the best way to fill the AI feature column of your table?
Grounding each cell in your own verified evidence keeps the table accurate and useful.
Finish the day
Mark the day complete to save your progress.
Next: Day 13 turns your findings into writing. You will learn to produce a clear, reproducible report from your lab notes and use an assistant to tighten it without adding claims you cannot prove.
Your notes
Private to this device. Write what you want to remember from today.