title: SSRF File Scheme Local File Read
id: ATR-2026-01608
rule_version: 1
status: experimental
description: |
  Detects SSRF attempts using the file:// URI scheme to read local filesystem
  files via an agent's HTTP-fetch or URL-retrieval tool. Unlike network-based
  SSRF, file:// scheme attacks directly read OS files such as /etc/passwd,
  /etc/shadow, SSH private keys, or application configuration files containing
  secrets. Many HTTP client libraries and agent tools support file:// URIs
  unless explicitly blocked. Also catches absolute path injection (/etc/passwd)
  as a direct file read vector in fetch-style tool arguments.
author: ATR Community
date: 2026/06/12
schema_version: '0.1'
detection_tier: pattern
maturity: test
severity: critical
references:
  owasp_llm:
    - LLM02:2025
  owasp_agentic:
    - ASI03:2026
  mitre_atlas:
    - AML.T0043 - Craft Adversarial Data
  mitre_attack:
    - T1083 - File and Directory Discovery
compliance:
  owasp_llm:
    - id: LLM02:2025
      context: File scheme SSRF leaks OS credentials and secrets from local filesystem.
      strength: primary
  nist_ai_rmf:
    - subcategory: MS.2.7
      context: Detection of file:// scheme SSRF supports MEASURE 2.7 security evaluation.
      strength: primary
  eu_ai_act:
    - article: '15'
      context: File scheme SSRF is an adversarial input targeting the local filesystem; Article 15 mandates detection.
      strength: primary
  iso_42001:
    - clause: '8.1'
      context: Operational controls under Clause 8.1 must detect and block agent tool inputs using the file:// scheme to read local filesystem paths (e.g. /etc/passwd, credential files) outside the intended data scope.
      strength: primary
    - clause: '6.2'
      context: ISO/IEC 42001 Clause 6.2 (AI objectives and planning) requires risk treatment of known attack patterns; detecting file-scheme SSRF that exfiltrates OS credentials and secrets is such a treatment.
      strength: secondary
tags:
  category: context-exfiltration
  subcategory: ssrf
  scan_target: tool_args
  confidence: high
agent_source:
  type: tool_call
  framework:
    - any
  provider:
    - any
detection:
  conditions:
    - field: tool_args
      operator: regex
      value: (?i)file:///(?:etc/(?:passwd|shadow|sudoers|hosts|ssh)|root/|home/\w+/\.ssh|proc/|dev/mem)
      description: file:// URI targeting sensitive OS paths
    - field: user_input
      operator: regex
      value: (?i)file:///(?:etc/(?:passwd|shadow|sudoers|hosts)|root/|home/[^/]+/\.ssh|proc/|dev/mem)
      description: file:// targeting sensitive Unix paths in user input
    - field: tool_args
      operator: regex
      value: (?i)/etc/(?:shadow|sudoers|ssl/private)
      description: Direct sensitive Unix file path in fetch/read tool argument
  condition: any
  false_positives:
    - Local documentation agents explicitly permitted to read project files
    - Filesystem agents with scoped read access to specific directories
response:
  actions:
    - block_tool
    - alert
    - escalate
    - snapshot
  auto_response_threshold: critical
  message_template: |
    [ATR-2026-01608] SSRF file scheme or sensitive path read detected.
    Request targets local filesystem. Tool call blocked.
confidence: 92
