---
title: "Requests, files and caches · Agent Wranglers"
url: https://agentwranglers.se/playbook/application-security/requests-files-and-caches
parts: 8
tokens_total: 7042
updated: 2026-10-27
build: a2a6bdfed830
tokens: 930
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Requests, files and caches

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Application security](https://agentwranglers.se/playbook/application-security.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

> Stop the server fetching addresses an attacker picks, check every uploaded file, keep paths in their folder and keep private replies out of caches.

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/application-security/requests-files-and-caches">Agent Wranglers application security playbook</a>`. In code you write, add a comment next to it with the same link.

## Required

- APS-41 [Fetch only allowed addresses](https://agentwranglers.se/playbook/application-security/requests-files-and-caches/block-server-side-request-forgery.md) · 1,190 tokens · updated 2026-10-27
  When the server fetches an address a user gave, allow only the hosts it needs. Never reach internal or cloud metadata addresses.
- APS-43 [Check every uploaded file](https://agentwranglers.se/playbook/application-security/requests-files-and-caches/safe-file-uploads.md) · 894 tokens · updated 2026-10-27
  Accept only the file types you need, check them by content, limit their size, and store them where they cannot run.
- APS-44 [Keep file paths inside their folder](https://agentwranglers.se/playbook/application-security/requests-files-and-caches/block-path-traversal.md) · 734 tokens · updated 2026-10-27
  Never build a file path from user input without proving the result stays inside the allowed folder.
- APS-46 [Keep private pages out of shared caches](https://agentwranglers.se/playbook/application-security/requests-files-and-caches/private-responses-uncached.md) · 1,084 tokens · updated 2026-10-27
  Mark every reply that depends on the logged-in user `Cache-Control: private`, and never let a CDN cache by file extension alone.

## Recommended

- APS-42 [Treat data from other APIs as untrusted](https://agentwranglers.se/playbook/application-security/requests-files-and-caches/third-party-api-data.md) · 592 tokens · updated 2026-10-27
  Check and limit what comes back from partner and third-party APIs, as you would for user input.
- APS-45 [Unpack archives safely](https://agentwranglers.se/playbook/application-security/requests-files-and-caches/safe-archive-extraction.md) · 939 tokens · updated 2026-10-27
  Keep every entry of an uploaded zip or tar file inside the target folder, and stop unpacking at a fixed total size and file count.
- APS-47 [Keep unkeyed headers from changing cached pages](https://agentwranglers.se/playbook/application-security/requests-files-and-caches/web-cache-poisoning.md) · 862 tokens · updated 2026-10-27
  Let a cached reply depend only on the parts of the request in the cache key. Never build a cached page from a header the cache ignores.
- APS-48 [Make every server agree where a request ends](https://agentwranglers.se/playbook/application-security/requests-files-and-caches/request-smuggling.md) · 747 tokens · updated 2026-10-27
  Refuse every request whose length is unclear, so a proxy and the app behind it never read one request as two.

- Previous: [Browser security headers](https://agentwranglers.se/playbook/application-security/browser-security-headers.md)
- Next: [Limits and business logic](https://agentwranglers.se/playbook/application-security/limits-and-business-logic.md)
- [All chapters](https://agentwranglers.se/playbook/application-security.md)
