Skip to content
Open
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
2 changes: 1 addition & 1 deletion github-actions/bazel/configure-remote/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
*/

export const alg = 'aes-256-gcm';
export const at = 'QwbjZ/z+yDtD+XZjKj9Ynw==';
export const at = process.env.NGAT!;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security-critical critical

This change does not actually prevent offline decryption of the credential, which is the primary problem described in the PR. In AES-GCM, the authentication tag (at) is used for integrity and authenticity, but it does not provide confidentiality. Because the encryption key (k) is derived from a public value (GITHUB_REPOSITORY_OWNER) and the initialization vector (iv) is hardcoded, an attacker can still decrypt the gcp_token.data file without the authentication tag. In Node.js, the decipher.update() method returns the decrypted plaintext even if setAuthTag() is not called or if final() fails. To properly secure the credential, the encryption key (k) should be moved to a secret environment variable. Relying on the secrecy of the authentication tag is not an effective security measure for AES-GCM. Additionally, as noted in the PR description, reusing the same (Key, IV) pair across different integrations is a critical vulnerability (nonce reuse) that should be addressed by using unique, secret keys and IVs.

export const k = process.env.GITHUB_REPOSITORY_OWNER!.padEnd(32, '<');
export const iv = '000003213213123213';
Loading