You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Note that in **some cases** you will be able to access the **EC2 metadata instance** from the container (check IMDSv2 TTL limitations mentioned previously). In these scenarios from the container you could access both the container IAM role and the EC2 IAM role.
113
113
114
+
### SSRF in AWS EKS Pod Identity credentials
115
+
116
+
Recent EKS clusters can use **Pod Identity** instead of the older ECS-style relative URI flow. In these pods, EKS injects:
Therefore, a SSRF/LFI capable of reading **env vars** or the projected **service account token file** can often recover the pod IAM credentials by querying the local credential endpoint with the authorization token from that file:
This is especially useful in **EKS webhooks**, **templating services**, or **URL fetchers** that run inside pods and expose a SSRF plus a local file read primitive. The response contains temporary AWS credentials that can be reused from the AWS CLI or tooling such as **Pacu**.
134
+
114
135
### SSRF for AWS Lambda
115
136
116
137
In this case the **credentials are stored in env variables**. So, to access them you need to access something like **`file:///proc/self/environ`**.
@@ -119,7 +140,7 @@ The **name** of the **interesting env variables** are:
119
140
120
141
-`AWS_SESSION_TOKEN`
121
142
-`AWS_SECRET_ACCESS_KEY`
122
-
-`AWS_ACCES_KEY_ID`
143
+
-`AWS_ACCESS_KEY_ID`
123
144
124
145
Moreover, in addition to IAM credentials, Lambda functions also have **event data that is passed to the function when it is started**. This data is made available to the function via the [runtime interface](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html) and could contain **sensitive****information** (like inside the **stageVariables**). Unlike IAM credentials, this data is accessible over standard SSRF at **`http://localhost:9001/2018-06-01/runtime/invocation/next`**.
125
146
@@ -318,6 +339,23 @@ for sa in $(curl -s -f -H "Metadata-Flavor: Google" "http://metadata/computeMeta
318
339
done
319
340
```
320
341
342
+
### Cloud Run / Cloud Functions 2nd gen
343
+
344
+
For **Cloud Run** and **2nd generation Cloud Functions** it is usually more interesting to steal not only the OAuth access token, but also an **audience-bound identity token** from the metadata server. This is useful when the compromised workload can reach **private Cloud Run services**, **IAP-protected backends**, or any service validating Google-issued ID tokens.
345
+
346
+
```bash
347
+
# OAuth access token for the attached service account
> The **`identity`** endpoint requires an **`audience`** parameter. In real engagements this usually means that, after proving SSRF against `token`, you should enumerate internal service URLs and then request a second token with the exact audience expected by the target service.
358
+
321
359
## Digital Ocean
322
360
323
361
> [!WARNING]
@@ -605,12 +643,24 @@ The necessity for a header is not mentioned here either. Metadata is accessible
605
643
606
644
## Oracle Cloud
607
645
608
-
Oracle Cloud provides a series of endpoints for accessing various metadata aspects:
646
+
Oracle Cloud Infrastructure has an **IMDSv2** mode that is much more relevant today than the legacy `/latest/` examples. In IMDSv2:
647
+
648
+
- Requests go to `http://169.254.169.254/opc/v2/`
649
+
- Requests must include the header `Authorization: Bearer Oracle`
650
+
- Requests carrying `Forwarded`, `X-Forwarded-For`, or `X-Forwarded-Host` are rejected
651
+
- If the instance is configured to only allow IMDSv2, the old `/opc/v1` and `/openstack` paths return `404`
609
652
610
-
- `http://192.0.0.192/latest/`
611
-
- `http://192.0.0.192/latest/user-data/`
612
-
- `http://192.0.0.192/latest/meta-data/`
613
-
- `http://192.0.0.192/latest/attributes/`
653
+
Interesting endpoints:
654
+
655
+
```bash
656
+
curl -s -H "Authorization: Bearer Oracle" \
657
+
http://169.254.169.254/opc/v2/instance/
658
+
659
+
curl -s -H "Authorization: Bearer Oracle" \
660
+
http://169.254.169.254/opc/v2/vnics/
661
+
```
662
+
663
+
So, from an SSRF perspective, OCI now behaves much closer to the hardened cloud metadata services that require a **mandatory header** and explicitly reject common **forwarded-header proxy patterns**.
614
664
615
665
## Alibaba
616
666
@@ -643,6 +693,11 @@ Rancher's metadata can be accessed using:
0 commit comments