AWS - Apigateway Privesc
Last updated
Last updated
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
For more information check:
AWS - API Gateway Enumapigateway:POST
With this permission you can generate API keys of the APIs configured (per region).
Potential Impact: You cannot privesc with this technique but you might get access to sensitive info.
apigateway:GET
With this permission you can get generated API keys of the APIs configured (per region).
Potential Impact: You cannot privesc with this technique but you might get access to sensitive info.
apigateway:UpdateRestApiPolicy
, apigateway:PATCH
With these permissions it's possible to modify the resource policy of an API to give yourself access to call it and abuse potential access the API gateway might have (like invoking a vulnerable lambda).
Potential Impact: You, usually, won't be able to privesc directly with this technique but you might get access to sensitive info.
apigateway:PutIntegration
, apigateway:CreateDeployment
, iam:PassRole
Need testing
An attacker with the permissions apigateway:PutIntegration
, apigateway:CreateDeployment
, and iam:PassRole
can add a new integration to an existing API Gateway REST API with a Lambda function that has an IAM role attached. The attacker can then trigger the Lambda function to execute arbitrary code and potentially gain access to the resources associated with the IAM role.
Potential Impact: Access to resources associated with the Lambda function's IAM role.
apigateway:UpdateAuthorizer
, apigateway:CreateDeployment
Need testing
An attacker with the permissions apigateway:UpdateAuthorizer
and apigateway:CreateDeployment
can modify an existing API Gateway authorizer to bypass security checks or to execute arbitrary code when API requests are made.
Potential Impact: Bypassing security checks, unauthorized access to API resources.
apigateway:UpdateVpcLink
Need testing
An attacker with the permission apigateway:UpdateVpcLink
can modify an existing VPC Link to point to a different Network Load Balancer, potentially redirecting private API traffic to unauthorized or malicious resources.
Potential Impact: Unauthorized access to private API resources, interception or disruption of API traffic.
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE) Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)