fix(iam): return GetFunction's tags only to a caller allowed lambda:ListTags (#9782)

The Lambda API reference says of GetFunction's Tags "Lambda returns tag data only if you have explicit allow
permissions for lambda:ListTags", and the Service Reference lists lambda:ListTags among the actions GetFunction is
authorized by. Floci returned a function's tags to every caller allowed lambda:GetFunction.

tools/aws/fetch_lambda_response_permissions.py vendors, from the API reference page of each operation the Service
Reference lists as authorized by an action beside its own and the reference's operations page documents, each
response element's sentence saying it is returned only with a permission, with the element and the action. It
refuses a sentence naming a permission and a lambda: action in any other wording, and a page whose response elements
section is missing or lists no element without saying the response is empty, so a reworded or relaid page fails
rather than dropping the check. The authorized-actions generator reads it into a returnedOnlyIf
section, where botocore's response of the operation has a member of the element's name and the Service Reference
lists the action among the operation's: GetFunction returns Tags only with lambda:ListTags. IamAuthorizedActions
reads it, and LambdaController leaves the member out of a GetFunction response to a caller not allowed the action on
the function, checked with the function's tags through IamEnforcementFilter.authorizeEntryResource. TagsError is not
set, as no recording of AWS's answer for that case gives its code and message.

IamEnforcementFilter.requestAuthorization, which hands a handler the caller the filter evaluated, now treats a blank
Authorization header as no credential, as the filter itself does, and falls back to the presigned X-Amz-Credential;
before, a request with a blank header and a query credential passed the filter as that credential and the handler's
check as unsigned, so GetFunction returned Tags to a caller not allowed lambda:ListTags.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-11-29 22:09:26 -04:00
1 parent 76d93ddc32
commit 1dc6478108
16 files changed
+621 -10

No files matched your search

+6
View File
@@ -652,6 +652,12 @@ that layer. A request giving no `Layers` is not checked as it. Another account's
checked on its own ARN alone, against its owner's policy, never as a same-named layer of the
caller's, as Lambda never substitutes one.
**GetFunction's tags under IAM enforcement:** `GetFunction` returns `Tags` only to a caller allowed
`lambda:ListTags` on the function, as the API reference says ("Lambda returns tag data only if you
have explicit allow permissions for lambda:ListTags"); a caller allowed `GetFunction` alone, or
denied `lambda:ListTags`, reads the function without them. `TagsError` is not set, as no recording
of AWS's error for that case gives its code and message.
## Provisioned concurrency
Published versions with `SnapStart.ApplyOn=PublishedVersions` reject provisioned concurrency