Fix Critical Compromise of Multitenant CAP apps - #579
Merged
Conversation
akgarg06
requested review from
PujaDeshmukh17,
vibhutikumar07 and
yashmeet29
as code owners
September 4, 2026 06:06
vibhutikumar07
approved these changes
Sep 4, 2026
vibhutikumar07
left a comment
Contributor
There was a problem hiding this comment.
LGTM but need to revert once required version available on npm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
CI/deploy workflows that build the CAP sample apps need
@sap/cds-mtxs@3.9.7and@sap/cds-dk@9.9.5, which don't exist on public npm (public maxes at3.9.6/9.9.4) and only live on SAP's internal registries. Theintrepo has them but requires VPN (unavailable in CI); thecommonsrepo is public-facing but doesn't host all@sappackages. Additionally, BlackDuck was reporting a stale@sap/cds-mtxs@3.9.5from the sample apps.How
@sapscope → public npm, with the two internal-only packages pinned to direct commons tarball URLs (a URL dependency bypasses the scope-registry rule, since npm allows only one registry per scope).SAP_CDS_MTXS_TARBALL,SAP_CDS_DK_TARBALL,NPM_AUTH_TOKEN) — never committed, masked in logs. The committedpackage.jsonfiles stay on clean exact versions (3.9.7/9.9.5) so BlackDuck can match them to its knowledge base..npmrcand usesjq(guarded — only rewrites keys that already exist) to inject the tarball URLs into the relevantpackage.jsonfiles beforenpm install/mbt build.overrides["@sap/cds-mtxs"]to force the transitivecds-mtxs@3.9.5(pulled in bycds-dk's own"^3"dependency) up to3.9.7— this is what fixed the version BlackDuck was reporting.blackduck.yml,package.jsonis restored viagit checkoutafter install, so the scan reads clean version strings against the correctly-resolvednode_modulestree.legacy-peer-deps=trueto resolve CAP peer-dependency conflicts.Workflows changed
Applied to every workflow that runs
npm install/mbt buildinside a sample-app directory:blackduck.yml— Node setup + install loop over all 4 multi-tenant dirs + restore for clean scanmultiTenancyDeployLocal.yml— multi-tenant (personal-space)mbt buildmultiTenant_deploy_and_Integration_test.yml— multi-tenant (central-space)mbt buildmultiTenant_deploy_and_Integration_test_LatestVersion.yml— multi-tenant (central-space)mbt buildcfdeploy.yml— single-tenant deploy (defensive.npmrc; jq is a no-op here since single-tenant doesn't declare the internal packages)Not changed (with reasons)
singleTenant_deploy_and_Integration_test*.yml,singleTenant_integration_test.yml) andmulti tenancy_Integration.yml— either runmvn verifyagainst already-deployed CF apps (no npm build), or build the single-tenant app, which resolvescds-dkfrom public npm and doesn't declare the internal-only packages.main-build*.yml,pull-request-build.yml,unit.tests.yml,sonarqube.yml,codeql.yml,deploy-central-snapshot.yml,demo-build.yml,internalArticatory.yml,new_wokflow_test.yml,SAPUI5_Version_Monitoring.yml) — the rootpom.xmlreactor contains only<module>sdm</module>, somvn clean installbuilds just the plugin and never entersapp/**or triggerscds build/npm for the sample apps.Required secrets
Set the following in environments (or at repo level):
SAP_CDS_MTXS_TARBALL<URL>/@sap/cds-mtxs/-/@sap/cds-mtxs-3.9.7.tgzSAP_CDS_DK_TARBALL<URL>/@sap/cds-dk/-/@sap/cds-dk-9.9.5.tgzNPM_AUTH_TOKENType of change
Please delete options that are not relevant.
Checklist before requesting a review
Single Tenant Integration test : https://github.com/cap-java/sdm/actions/runs/33757057322
Multi Tenant Integration test : https://github.com/cap-java/sdm/actions/runs/33757094896