Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps-script/chat/a2ui-useraction-ai-agent/appsscript.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"chat": {}
},
"oauthScopes": [
"https://www.googleapis.com/auth/iam",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

The https://www.googleapis.com/auth/iam scope grants broad permissions to view and manage all of a user's Google Cloud IAM resources. Following the principle of least privilege, such a powerful scope should only be requested when strictly necessary.

The script in Credentials.gs supports two authentication methods:

  1. Service account impersonation (which requires this iam scope).
  2. Using a service account key (which does not require this scope).

By including this scope in the manifest, all users of the add-on will be prompted to grant this powerful permission, even if their configuration uses the service account key method. This leads to an over-provisioning of permissions for those users and increases the potential security risk.

To mitigate this, consider one of the following approaches:

  • Support only one authentication method (e.g., service account impersonation) to ensure the requested scope is always required.
  • If both methods must be supported, clearly document for administrators that this permission is only needed for the impersonation flow, and explain the security implications. This allows them to make an informed decision.

"https://www.googleapis.com/auth/script.external_request"
]
}
Loading