Skip to content

Commit 06c0c04

Browse files
committed
reorg bedrock
1 parent 98eb150 commit 06c0c04

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

src/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
- [AWS - STS Persistence](pentesting-cloud/aws-security/aws-persistence/aws-sts-persistence/README.md)
249249
- [AWS - Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/README.md)
250250
- [AWS - API Gateway Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-api-gateway-post-exploitation/README.md)
251+
- [AWS - Bedrock Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-bedrock-post-exploitation/README.md)
251252
- [AWS - CloudFront Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-cloudfront-post-exploitation/README.md)
252253
- [AWS - CodeBuild Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-codebuild-post-exploitation/README.md)
253254
- [AWS Codebuild - Token Leakage](pentesting-cloud/aws-security/aws-post-exploitation/aws-codebuild-post-exploitation/aws-codebuild-token-leakage.md)
@@ -361,7 +362,7 @@
361362
- [AWS - Trusted Advisor Enum](pentesting-cloud/aws-security/aws-services/aws-security-and-detection-services/aws-trusted-advisor-enum.md)
362363
- [AWS - WAF Enum](pentesting-cloud/aws-security/aws-services/aws-security-and-detection-services/aws-waf-enum.md)
363364
- [AWS - API Gateway Enum](pentesting-cloud/aws-security/aws-services/aws-api-gateway-enum.md)
364-
- [Aws Bedrock Agents Memory Poisoning](pentesting-cloud/aws-security/aws-services/aws-bedrock-agents-memory-poisoning.md)
365+
- [AWS - Bedrock Enum](pentesting-cloud/aws-security/aws-services/aws-bedrock-enum.md)
365366
- [AWS - Certificate Manager (ACM) & Private Certificate Authority (PCA)](pentesting-cloud/aws-security/aws-services/aws-certificate-manager-acm-and-private-certificate-authority-pca.md)
366367
- [AWS - CloudFormation & Codestar Enum](pentesting-cloud/aws-security/aws-services/aws-cloudformation-and-codestar-enum.md)
367368
- [AWS - CloudHSM Enum](pentesting-cloud/aws-security/aws-services/aws-cloudhsm-enum.md)

src/pentesting-cloud/aws-security/aws-services/aws-bedrock-agents-memory-poisoning.md renamed to src/pentesting-cloud/aws-security/aws-post-exploitation/aws-bedrock-post-exploitation/README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
# AWS - Bedrock Agents Memory Poisoning (Indirect Prompt Injection)
1+
# AWS - Bedrock Post Exploitation
22

33
{{#include ../../../banners/hacktricks-training.md}}
44

5-
## Overview
5+
6+
## AWS - Bedrock Agents Memory Poisoning (Indirect Prompt Injection)
7+
8+
### Overview
69

710
Amazon Bedrock Agents with Memory can persist summaries of past sessions and inject them into future orchestration prompts as system instructions. If untrusted tool output (for example, content fetched from external webpages, files, or third‑party APIs) is incorporated into the input of the Memory Summarization step without sanitization, an attacker can poison long‑term memory via indirect prompt injection. The poisoned memory then biases the agent’s planning across future sessions and can drive covert actions such as silent data exfiltration.
811

912
This is not a vulnerability in the Bedrock platform itself; it’s a class of agent risk when untrusted content flows into prompts that later become high‑priority system instructions.
1013

11-
## How Bedrock Agents Memory works (relevant pieces)
14+
### How Bedrock Agents Memory works
1215

1316
- When Memory is enabled, the agent summarizes each session at end‑of‑session using a Memory Summarization prompt template and stores that summary for a configurable retention (up to 365 days). In later sessions, that summary is injected into the orchestration prompt as system instructions, strongly influencing behavior.
1417
- The default Memory Summarization template includes blocks like:
@@ -17,14 +20,14 @@ This is not a vulnerability in the Bedrock platform itself; it’s a class of ag
1720
- Guidelines require strict, well‑formed XML and topics like "user goals" and "assistant actions".
1821
- If a tool fetches untrusted external data and that raw content is inserted into $conversation$ (specifically the tool’s result field), the summarizer LLM may be influenced by attacker‑controlled markup and instructions.
1922

20-
## Attack surface and preconditions
23+
### Attack surface and preconditions
2124

2225
An agent is exposed if all are true:
2326
- Memory is enabled and summaries are reinjected into orchestration prompts.
2427
- The agent has a tool that ingests untrusted content (web browser/scraper, document loader, third‑party API, user‑generated content) and injects the raw result into the summarization prompt’s `<conversation>` block.
2528
- Guardrails or sanitization of delimiter‑like tokens in tool outputs are not enforced.
2629

27-
## Injection point and boundary‑escape technique
30+
### Injection point and boundary‑escape technique
2831

2932
- Precise injection point: the tool’s result text that is placed inside the Memory Summarization prompt’s `<conversation> ... $conversation$ ... </conversation>` block.
3033
- Boundary escape: a 3‑part payload uses forged XML delimiters to trick the summarizer into treating attacker content as if it were template‑level system instructions instead of conversation content.
@@ -61,13 +64,13 @@ Notes:
6164

6265
</details>
6366

64-
## Why it persists and how it triggers
67+
### Why it persists and how it triggers
6568

6669
- The Memory Summarization LLM may include attacker instructions as a new topic (for example, "validation goal"). That topic is stored in the per‑user memory.
6770
- In later sessions, the memory content is injected into the orchestration prompt’s system‑instruction section. System instructions strongly bias planning. As a result, the agent may silently call a web‑fetching tool to exfiltrate session data (for example, by encoding fields in a query string) without surfacing this step in the user‑visible response.
6871

6972

70-
## Reproducing in a lab (high level)
73+
### Reproducing in a lab (high level)
7174

7275
- Create a Bedrock Agent with Memory enabled and a web‑reading tool/action that returns raw page text to the agent.
7376
- Use default orchestration and memory summarization templates.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# AWS - Bedrock
2+
3+
{{#include ../../../banners/hacktricks-training.md}}
4+
5+
## Overview
6+
7+
Amazon Bedrock is a fully managed service that makes it easy to build and scale generative AI applications using foundation models (FMs) from leading AI startups and Amazon. Bedrock provides access to various FMs through a single API, allowing developers to choose the most suitable model for their specific use cases without managing the underlying infrastructure.
8+
9+
## Post Exploitation
10+
11+
{{#ref}}
12+
../../aws-post-exploitation/aws-bedrock-post-exploitation/README.md
13+
{{#endref}}
14+
15+
{{#include ../../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)