Skip to navigation

Threat reportCloud SecurityTL-2026-0331

AWS Bedrock AgentCore Sandbox Escape via DNS Tunneling and Metadata Service Exploitation

highMONITORING

Unit 42 researchers discovered critical weaknesses in Amazon Bedrock AgentCore's Sandbox Mode isolation that enable DNS tunneling for bidirectional data exfiltration and C2 communication, legacy MMDSv1 exploitation for IAM credential theft, and infrastructure information disclosure including pre-signed S3 URLs and KMS Key IDs.

Key facts

IdentifiersTL-2026-0331
Also known asCracks in the Bedrock, AgentCore Sandbox Escape
SeverityHIGH
Affected productsAmazon Web Services Amazon Bedrock AgentCore; Amazon Web Services Amazon Bedrock Code Interpreter; Amazon Web Services Amazon Bedrock Browser Tool
Weaknesses (CWE)CWE-918, CWE-200, CWE-269, CWE-668
MITRE ATT&CK techniquesT1048 Exfiltration Over Alternative Protocol, T1059 Command and Scripting Interpreter, T1071 Application Layer Protocol, T1078 Valid Accounts, T1082 System Information Discovery, T1190 Exploit Public-Facing Application, T1530 Data from Cloud Storage, T1552 Unsecured Credentials, T1572 Protocol Tunneling, T1580 Cloud Infrastructure Discovery, T1619 Cloud Storage Object Discovery
MotivationUNKNOWN
Target sectorstechnology, financial, healthcare, government, cloud-services, artificial-intelligence
Target regionsGlobal
Detection rules9 (1 shown free)
Sources8 cited sources

Detection coverage

As of 2026-04-07, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-0331 across Splunk SPL, Microsoft KQL and Sigma, covering 15 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.

Free detection: AWS Bedrock AgentCore DNS Tunneling Detection

Detects high-volume DNS TXT/CNAME queries indicative of DNS tunneling from AWS Bedrock AgentCore sandbox environments, targeting data exfiltration and C2 communication channels.

  • Languages: Splunk SPL, Microsoft KQL, Sigma
  • ATT&CK: T1071.004, T1572, T1048.003
  • Data sources: DNS logs, AWS CloudTrail, Route53 query logs
  • Severity: critical
  • Confidence: high

Splunk SPL

index=dns sourcetype=stream:dns OR sourcetype=aws:cloudtrail (query_type=TXT OR query_type=CNAME) | eval subdomain_len=len(mvindex(split(query, "."), 0)) | where subdomain_len > 40 OR len(query) > 100 | stats count dc(query) as unique_queries sum(subdomain_len) as total_encoded_len by src_ip | where count > 50 AND unique_queries > 20 | lookup aws_bedrock_instances ip AS src_ip OUTPUT instance_id | where isnotnull(instance_id) | table _time src_ip instance_id count unique_queries total_encoded_len

Microsoft KQL

DnsEvents | where QueryType in ('TXT', 'CNAME') | extend SubdomainLength = strlen(tostring(split(Name, '.')[0])) | where SubdomainLength > 40 or strlen(Name) > 100 | summarize QueryCount = count(), UniqueQueries = dcount(Name), TotalEncodedLen = sum(SubdomainLength) by ClientIP, bin(TimeGenerated, 5m) | where QueryCount > 50 and UniqueQueries > 20 | join kind=inner (AzureActivity | where ResourceProviderValue == 'MICROSOFT.MACHINELEARNINGSERVICES') on $left.ClientIP == $right.CallerIpAddress

Sigma

title: AWS Bedrock AgentCore DNS Tunneling
id: a1b2c3d4-0331-4001-a001-detectorrule01
status: experimental
author: Threadlinqs Team
date: 2026/04/08
description: Detects DNS tunneling activity from AWS Bedrock sandbox environments via high-entropy subdomain queries
logsource:
  category: dns
  product: aws
  service: route53
detection:
  selection:
    query_type:
      - TXT
      - CNAME
  filter_length:
    query|re: '^[a-zA-Z0-9]{40,}\..+'
  condition: selection and filter_length
falsepositives:
  - Legitimate DNS-based services with long subdomains
  - CDN domain validation
level: critical
tags:
  - attack.command_and_control
  - attack.t1071.004
  - attack.exfiltration
  - attack.t1048.003

Known false positives:

  • Low
8 more detection rules (Splunk SPL, Microsoft KQL, Sigma) · unlock with TL Creds. Sign up free to unlock the detection rules or query them with the Threadlinqs MCP server (Purple)
  • PowerShell DNS Exfiltration via Resolve-DnsName · unlock with TL Creds
  • Linux dig/nslookup DNS Tunneling from Cloud Sandbox · unlock with TL Creds
  • Python requests to Cloud Metadata Endpoints · unlock with TL Creds
  • AWS Bedrock API Anomalous InvokeAgent Calls · unlock with TL Creds
  • Cloud Sandbox Environment Discovery Commands · unlock with TL Creds
  • Outbound Connection to Known DNS Tunneling Domains · unlock with TL Creds
  • IMDS Metadata Service Credential Theft from Sandbox · unlock with TL Creds
  • Suspicious Pre-Signed S3 URL Generation from Bedrock Agent · unlock with TL Creds

Indicators of compromise

As of 2026-04-07, Threadlinqs Intelligence tracks 15 indicators of compromise for TL-2026-0331.

Sample indicators (2 of 15)

  • Domain: dnshook[.]site
  • Domain: s3[.]us-east-1[.]amazonaws[.]com

Defanged, TLP:CLEAR. Full set of 15 indicators: unlock with TL Creds.

15 indicators of compromise · unlock with TL Creds. Compare plans

Technical analysis

AWS enforced MMDSv2 defaults for new agents on February 14, 2026, but legacy agents remain vulnerable unless manually updated.

Unit 42 researcher Ori Hadad discovered multiple sandbox isolation bypasses in Amazon Bedrock AgentCore's Code Interpreter running in Sandbox Mode. The vulnerabilities chain together to defeat the sandbox's core isolation promise of "no external network access."

**DNS Tunneling Bypass (Primary Vector)**

Despite AgentCore's Sandbox Mode documentation claiming no external network access, the sandbox permitted DNS resolution to arbitrary external domains. Researchers demonstrated this by resolving both internal AWS services (s3.us-east-1.amazonaws.com) and external domains (google.com) from within the sandbox using Python's socket.gethostbyname_ex() function.

This DNS resolution capability was weaponized into a full bidirectional covert channel. By encoding sensitive data as subdomains of an attacker-controlled domain (e.g., base64-encoded-secret.dnshook.site), the sandbox's internal DNS resolver would recursively forward queries to the attacker's authoritative nameserver, effectively exfiltrating data encoded in DNS query labels. The reverse channel enables command-and-control by embedding instructions in DNS response records.

**MicroVM Metadata Service (MMDS) Exploitation**

The AgentCore sandbox runs on Firecracker microVMs, each with an ephemeral per-session lifecycle. The microVM's metadata service endpoint at 169.254.169.254 was configured with legacy MMDSv1 behavior — accepting standard HTTP GET requests without requiring a session token. This contrasts with EC2's IMDSv2 which mandates a PUT-based token exchange before metadata access.

This misconfiguration allowed direct retrieval of temporary IAM role credentials (Access Key ID, Secret Access Key, and Session Token) associated with the sandbox execution context. Combined with the DNS tunneling channel, these credentials could be exfiltrated to an attacker-controlled server.

**Infrastructure Information Disclosure**

Researchers discovered undocumented MMDS tag endpoints that exposed operational infrastructure details: - http://169.254.169.254/latest/meta-data/tags/instance/aws_presigned-log-url returned pre-signed S3 URLs with scoped write access to internal AWS logging buckets - http://169.254.169.254/latest/meta-data/tags/instance/aws_presigned-log-kms-key revealed KMS Key IDs used for backend infrastructure encryption

Additionally, malformed S3 requests triggered error responses containing the AWSAccessKeyID of the signing identity (beginning with ASI...X6L) and the owning AWS account number (209...9), enabling infrastructure reconnaissance.

**Attack Chain**

The complete exploitation chain proceeds as follows: (1) Confirm DNS resolution capability from sandbox, (2) Enumerate MMDS endpoints to harvest IAM credentials and infrastructure metadata, (3) Establish DNS tunneling channel to attacker-controlled nameserver, (4) Exfiltrate stolen credentials and infrastructure details via DNS subdomain encoding, (5) Use exfiltrated credentials externally for lateral movement within the victim's AWS environment.

**Sandbox Mode vs VPC Mode**

AWS Bedrock AgentCore offers two network isolation modes. Sandbox Mode provides limited isolation with DNS access and S3 connectivity for logging. VPC Mode deploys into customer-controlled subnets with full network control including Route 53 Resolver DNS Firewall capability. Unit 42 recommends VPC Mode for production and sensitive workloads.

**Remediation**

AWS responded by enforcing MMDSv2 as the default for all new AgentCore agents as of February 14, 2026, and providing an API option for customers to disable IMDSv1 on existing agents. AWS also updated documentation to more accurately describe Sandbox Mode's network capabilities as "limited external network access" rather than implying complete isolation.

MITRE ATT&CK techniques by tactic:

exfiltration

T1048 Exfiltration Over Alternative Protocol

execution

T1059 Command and Scripting Interpreter

command-and-control

T1071 Application Layer Protocol; T1572 Protocol Tunneling

defense-evasion

T1078 Valid Accounts

discovery

T1082 System Information Discovery; T1580 Cloud Infrastructure Discovery; T1619 Cloud Storage Object Discovery

initial-access

T1190 Exploit Public-Facing Application

collection

T1530 Data from Cloud Storage

credential-access

T1552 Unsecured Credentials

Remediation

Patches

  • AWS enforced MMDSv2 as default for new AgentCore agents (February 14, 2026)
  • AWS provided API to disable IMDSv1 on legacy agents — apply immediately
  • AWS updated Sandbox Mode documentation to clarify limited network access

Immediate actions

  • Disable IMDSv1 on all existing Bedrock AgentCore agents via AWS API
  • Migrate AgentCore deployments from Sandbox Mode to VPC Mode
  • Implement Route 53 Resolver DNS Firewall rules in VPC Mode to block unauthorized DNS resolution
  • Audit IAM roles attached to AgentCore Code Interpreter for least privilege compliance
  • Review CloudTrail logs for anomalous STS or metadata service access from AgentCore execution contexts

Workarounds

  • Use VPC Mode instead of Sandbox Mode for all sensitive workloads
  • Apply restrictive security group and NACL rules to AgentCore VPC subnets
  • Monitor DNS query logs from AgentCore execution environments for data exfiltration indicators

Longer-term hardening

  • Deploy all AgentCore workloads in VPC Mode with DNS firewall policies
  • Implement network-level DNS monitoring for tunneling indicators (high-entropy subdomain queries, unusual query volumes)
  • Establish guardrails for AI agent code execution environments with defense-in-depth isolation
  • Integrate cloud workload protection platforms (CWPP) for runtime monitoring of serverless and microVM environments
  • Conduct periodic red team assessments of AI agent sandbox isolation boundaries

Affected and fixed versions

  • Amazon Web Services — Amazon Bedrock AgentCore
    Vulnerable versions: All Sandbox Mode deployments prior to February 14, 2026; Legacy agents without IMDSv1 disabled
    Fixed in: New agents created after February 14, 2026 (MMDSv2 default); Agents with IMDSv1 manually disabled via API
  • Amazon Web Services — Amazon Bedrock Code Interpreter
    Vulnerable versions: Sandbox Mode (pre-Feb 14, 2026)
    Fixed in: VPC Mode; Sandbox Mode with MMDSv2 enforced
  • Amazon Web Services — Amazon Bedrock Browser Tool
    Vulnerable versions: Sandbox Mode (pre-Feb 14, 2026)
    Fixed in: VPC Mode; Sandbox Mode with MMDSv2 enforced

Timeline

  • Unit 42 researcher Ori Hadad responsibly disclosed DNS tunneling, MMDS exploitation, and infrastructure disclosure vulnerabilities in AWS Bedrock AgentCore Sandbox Mode to AWS Security
  • AWS Security acknowledged the disclosure and began internal investigation into AgentCore sandbox isolation weaknesses
  • AWS requested additional technical details from Unit 42 researchers regarding the DNS tunneling and metadata service exploitation vectors
  • AWS provided remediation commitments including MMDSv2 enforcement and API controls for disabling IMDSv1 on existing agents
  • AWS enforced MMDSv2 as default for all new Bedrock AgentCore agents, mitigating the metadata service credential theft vector for new deployments
  • Unit 42 published full technical writeup with PoC details and remediation guidance titled Cracks in the Bedrock: Escaping the AWS AgentCore Sandbox
  • As of 2026-05-29, this remains live: AWS deemed the Sandbox-Mode DNS tunneling/C2 vector "intended functionality" and won't patch it (mitigation needs customer VPC Mode + DNS Firewall), and legacy MMDSv1 agents stay credential-exposed despite the Feb 14 2026 MMDSv2 default for new agents. It is an unattributed public PoC with no reported in-the-wild abuse, so MONITORING fits.

Sources cited

Previous and next in cloud

Drafted by the Threadlinqs research pipeline from 8 sources; published ; last updated —.

Threadlinqs Intelligence — Real-Time Threat Detection Platform

// threat_feed
$ sort --newest
Showing all threats

Live intelligence console

Threat level

Latest Threats