Skip to content

Commit d10beb1

Browse files
author
HackTricks News Bot
committed
Add content from: The Global Namespace Risk: Universal Bucket Hijacking Techni...
1 parent 901f745 commit d10beb1

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

src/pentesting-cloud/pentesting-cloud-methodology.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,50 @@ Each cloud has its own peculiarities but in general there are a few **common thi
3232
- For **integrations inside the cloud you are auditing** from external platforms, you should ask **who has access externally to (ab)use that integration** and check how is that data being used.\
3333
For example, if a service is using a Docker image hosted in GCR, you should ask who has access to modify that and which sensitive info and access will get that image when executed inside an AWS cloud.
3434

35+
### Hunt autonomous data streams that write into globally-unique storage
36+
37+
A recurring **cross-cloud post-exploitation primitive** is to find **long-lived routers / sinks / subscriptions / replication jobs** that keep writing into a storage destination identified mainly by a **globally unique name**. If an attacker can **empty + delete** that destination and then **recreate the same name** in an attacker-controlled project/account/subscription, the upstream service may continue delivering data to the replacement destination **without modifying the router resource itself**.
38+
39+
This is interesting because it can **bypass the expected permission boundary**: the attacker might not have the permissions needed to update the router (for example `logging.sinks.update`, `pubsub.subscriptions.update` or similar), but a broad destructive storage permission such as `storage.buckets.delete`, `s3:DeleteBucket`, or `Microsoft.Storage/storageAccounts/delete` can still produce equivalent data redirection.
40+
41+
**Generic attack flow:**
42+
43+
1. Identify automated data streams that write to buckets / storage accounts and are expected to run unattended.
44+
2. Verify whether the destination is referenced by **name** and whether that name is **reclaimable** after deletion.
45+
3. Check if your current principal can delete the destination even if it cannot update the router resource.
46+
4. Delete the destination, recreate the same globally-unique name under attacker control, and wait for the next log/message/object delivery cycle.
47+
48+
**Good targets to review:**
49+
50+
- **GCP**: Cloud Logging sinks to GCS, Pub/Sub Cloud Storage subscriptions, Storage Transfer Service jobs.
51+
- **AWS**: S3 replication destinations, Firehose streams writing to S3, and any other service that continuously writes into an S3 bucket by name.
52+
- **Azure**: Azure Monitor diagnostic settings writing to Storage Accounts, especially when deletion/recreation is possible inside the same tenant.
53+
54+
**Quick hunting checklist:**
55+
56+
```bash
57+
# GCP: sinks, subscriptions and transfer jobs that may target GCS
58+
gcloud logging sinks list
59+
gcloud pubsub subscriptions list
60+
gcloud transfer jobs list
61+
62+
# AWS: replication and Firehose destinations
63+
aws s3api get-bucket-replication --bucket <source-bucket>
64+
aws firehose describe-delivery-stream --delivery-stream-name <stream-name>
65+
66+
# Azure: diagnostic settings pointing to storage accounts
67+
az monitor diagnostic-settings list --resource <resource-id>
68+
```
69+
70+
**What to report / detect:**
71+
72+
- Principals that can **delete storage destinations** but cannot formally update the associated router resource.
73+
- **Dangling router resources** still pointing to deleted buckets / storage accounts.
74+
- Sensitive log/export pipelines that can write to **external accounts/projects/subscriptions**.
75+
- High-severity alerts on deletion of buckets / storage accounts that are referenced by sinks, subscriptions, replication rules, transfer jobs, Firehose streams, or diagnostic settings.
76+
77+
When a cloud environment heavily relies on autonomous exports for **logs, audit trails, backups, telemetry, or message archival**, this review should be part of the standard methodology because the impact is usually **silent long-term exfiltration** rather than immediate service breakage.
78+
3579
## Multi-Cloud tools
3680

3781
There are several tools that can be used to test different cloud environments. The installation steps and links are going to be indicated in this section.
@@ -454,6 +498,13 @@ azure-security/
454498
confidential-computing/luks2-header-malleability-null-cipher-abuse.md
455499
{{#endref}}
456500

501+
## References
502+
503+
- [The Global Namespace Risk: Universal Bucket Hijacking Technique for Cloud Data Exfiltration](https://unit42.paloaltonetworks.com/cloud-bucket-hijacking-risks/)
504+
- [Cloud Logging routing and sinks](https://docs.cloud.google.com/logging/docs/export/configure_export_v2)
505+
- [Amazon S3 replication](https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html)
506+
- [Azure Monitor diagnostic settings](https://learn.microsoft.com/en-us/azure/azure-monitor/platform/diagnostic-settings)
507+
457508
{{#include ../banners/hacktricks-training.md}}
458509

459510

0 commit comments

Comments
 (0)