Skip to content

Release JavaScript GCP KMS Storage v1.0.0#874

Open
stas-schaller wants to merge 24 commits intomasterfrom
release/storage/javascript/gcp-kms/v1.0.0
Open

Release JavaScript GCP KMS Storage v1.0.0#874
stas-schaller wants to merge 24 commits intomasterfrom
release/storage/javascript/gcp-kms/v1.0.0

Conversation

@stas-schaller
Copy link
Contributor

@stas-schaller stas-schaller commented Nov 21, 2025

Release of @keeper-security/secrets-manager-gcp v1.0.0

Google Cloud Key Management Service integration for secure storage of Keeper Secrets Manager configuration.

Dependencies:

  • @keeper-security/secrets-manager-core v17.3.0
  • @google-cloud/kms v4.5.0

Bug Fixes

  • KSM-837: Fix contains()key in Object.keys(config) checked numeric array indices and always returned false for real config keys. Corrected to key in config. Add regression tests.
  • KSM-840: Fix delete() — truthy check if (config[key]) silently skipped deletion of keys with falsy values ("", 0). Corrected to if (key in config). Add regression tests.
  • KSM-847: Fix encryption/decryption error propagation — encryptBuffer() and decryptBuffer() in utils.ts returned empty values (Buffer.alloc(0) / "") on GCP KMS failure instead of rethrowing, silently discarding authentication failures, invalid key IDs, and permission errors; saveConfig() also caught and discarded errors without rethrowing; both layers now rethrow, making saveString(), saveBytes(), saveObject(), and changeKey() propagate GCP KMS failures as expected; changeKey()'s rollback path (key and crypto client restoration) is now reachable; removed vestigial blob.length > 0 guards in saveConfig() and createConfigFileIfMissing(), and dead plaintext.length > 0 guard in decryptConfig().
  • KSM-849: Fix getBytes() — falsy check if (bytesString) treated an empty base64 string ("", produced by saving a zero-length Uint8Array) as absent, returning undefined instead of Uint8Array(0). Corrected to if (bytesString !== undefined). Add regression tests.
  • Normalize 5 methods from private to public to match Azure and AWS: contains(), isEmpty(), deleteAll(), readStorage(), saveStorage().

Maintenance

  • Update axios from 1.13.2 to 1.7.9 to resolve high severity SSRF vulnerability (CVE-2025-27152). One low severity transitive finding remains (@tootallnate/once@2.0.0 via @google-cloud/kms) — unfixable without upstream GCP SDK update, accepted as low risk. Grype rescan: 1 low finding.

Closes https://keeper.atlassian.net/browse/KSM-704
Closes https://keeper.atlassian.net/browse/KSM-837
Closes https://keeper.atlassian.net/browse/KSM-840
Closes https://keeper.atlassian.net/browse/KSM-847
Closes https://keeper.atlassian.net/browse/KSM-849

Comment on lines +19 to +38
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./sdk/javascript/packages/gcp
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: sdk/javascript/packages/gcp/package-lock.json

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium test

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 4 months ago

To address the issue, the workflow YAML should be updated to specify a permissions block at the job or workflow root, stating the minimal necessary privileges. Since this workflow simply checks out code and runs tests — and does not perform write operations to the repository or PRs — the safest default is to set contents: read. This should be added as a new block immediately after the name: directive and before the on: directive (workflow root), or alternatively inside the test job. For clarity and to avoid unexpected privilege inheritance, the recommended location is at the workflow root; this will apply minimal permissions to all jobs.

No new methods or imports are needed to implement this; simply add the following YAML block in the right place:

permissions:
  contents: read
Suggested changeset 1
.github/workflows/test.javascript.storage.gcp.kms.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/test.javascript.storage.gcp.kms.yml b/.github/workflows/test.javascript.storage.gcp.kms.yml
--- a/.github/workflows/test.javascript.storage.gcp.kms.yml
+++ b/.github/workflows/test.javascript.storage.gcp.kms.yml
@@ -1,4 +1,6 @@
 name: Test JavaScript Storage - GCP KMS
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: Test JavaScript Storage - GCP KMS
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
satish-metron and others added 15 commits March 10, 2026 12:25
* Bump version

* fix: resolve DOM Clobbering CVE-2024-43788 (#689)

* fix: resolve DOM Clobbering CVE-2024-43788

* Upgrade JavaScript tests GHA to use Node 20

* fixed moduleResolution in tsconfig
updated all dependencies

* Added GCP KMS support to KSM Javascript SDK

* Added RAW_Encrypt functionality

* Revert "Added RAW_Encrypt functionality"

This reverts commit f6616be.

* * Fixed issues related to writing to file even when encryption failed
* Added support for GCP Raw Encrypt Decrypt type of key

---------

Co-authored-by: Ivan Dimov <78815270+idimov-keeper@users.noreply.github.com>
Co-authored-by: satish_chandra <metron_satish@safebreach.com>
Co-authored-by: Ayush Asati <ayush.asati@metronlabs.com>
- Updates @google-cloud/kms from 4.5.0 to 5.2.1
- Updates jws from 4.0.0 to 4.0.1 (via google-auth-library)
- Resolves HIGH severity vulnerability (CVSS 7.5)
- Fixes improper HMAC signature verification in auth0/node-jws
@stas-schaller stas-schaller force-pushed the release/storage/javascript/gcp-kms/v1.0.0 branch from 628a3fc to 9b588ed Compare March 10, 2026 16:26
…d visibility (KSM-837)

Fix contains() which incorrectly used `key in Object.keys(config)` — this checks
numeric array indices and always returns false for real config key strings. Corrected
to `key in config` which checks object property names directly.

Also normalize 5 methods from private to public to match Azure and AWS: contains(),
isEmpty(), deleteAll(), readStorage(), saveStorage(). None of these packages are
published yet, so this is a clean alignment.

Add regression tests for contains() to prevent recurrence.
…up-node in publish, npm ci, --ignore-scripts, .npmrc auth
axios@1.13.2 had a high severity SSRF vulnerability (CVE-2025-27152). Updated
to 1.7.9 via npm install and ran npm audit fix. One low severity transitive
finding remains (@tootallnate/once via @google-cloud/kms) — unfixable without
upstream GCP SDK update, accepted as low risk.
…-values

KSM-840: fix delete() skipping keys with falsy values in GCP storage
…BOM GHA false positives

- Upgrade actions/checkout, setup-node to v6 (SHA-pinned); upload-artifact to v7
- Bump node-version from 20 to 24 in all three jobs
- Syft v1.18.1 → v1.32.0 (Manifest CLI v0.31.0 max), Manifest CLI v0.18.3 → v0.31.0
- Disable github-action-workflow-usage-cataloger and github-actions-usage-cataloger
  in Syft config — eliminates GHA false positives from SBOM
- Fix retention-days: 90 → 10 (repo maximum)
- Add permissions: contents: read at workflow and job level
- Set persist-credentials: false on all checkout steps
- Use manifest (PATH) instead of /tmp/bin/manifest (hardcoded)
… Uint8Array

When an empty Uint8Array was stored, it was encoded as an empty base64
string (""). On retrieval, the falsy check (if bytesString) treated ""
as absent, returning undefined instead of Uint8Array(0). Fix replaces
truthy check with strict !== undefined guard.

KSM-849
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants