|
55 | 55 | required: false |
56 | 56 | default: yarn |
57 | 57 | type: string |
| 58 | + vulnerabilityCheck: |
| 59 | + description: if true, checks for known vulnerable package versions |
| 60 | + required: false |
| 61 | + default: true |
| 62 | + type: boolean |
58 | 63 | jobs: |
59 | 64 | check-publish: |
60 | 65 | outputs: |
@@ -131,6 +136,66 @@ jobs: |
131 | 136 | - name: Install dependencies with npm |
132 | 137 | if: inputs.packageManager == 'npm' |
133 | 138 | uses: salesforcecli/github-workflows/.github/actions/npmInstallWithRetries@main |
| 139 | + - name: Vulnerability check |
| 140 | + if: inputs.vulnerabilityCheck |
| 141 | + # Temporary check for known vulnerable packages from the following supply chain attack: |
| 142 | + # https://www.sonatype.com/blog/npm-chalk-and-debug-packages-hit-in-software-supply-chain-attack |
| 143 | + # Last updated 10:33 a.m. ET on September 9, 2025 |
| 144 | + run: | |
| 145 | + vulns=( |
| 146 | + "@coveops/abi@2.0.1" |
| 147 | + "@duckdb/duckdb-wasm@1.29.2" |
| 148 | + "@duckdb/node-api@1.3.3" |
| 149 | + "@duckdb/node-bindings@1.3.3" |
| 150 | + "ansi-regex@6.2.1" |
| 151 | + "ansi-styles@6.2.2" |
| 152 | + "backslash@0.2.1" |
| 153 | + "chalk@5.6.1" |
| 154 | + "chalk-template@1.1.1" |
| 155 | + "color@5.0.1" |
| 156 | + "color-convert@3.1.1" |
| 157 | + "color-name@2.0.1" |
| 158 | + "color-string@2.1.1" |
| 159 | + "debug@4.4.2" |
| 160 | + "duckdb@1.3.3" |
| 161 | + "error-ex@1.3.3" |
| 162 | + "has-ansi@6.0.1" |
| 163 | + "is-arrayish@0.3.3" |
| 164 | + "prebid@10.9.2" |
| 165 | + "prebid-universal-creative@1.17.3" |
| 166 | + "prebid.js@10.9.2" |
| 167 | + "proto-tinker-wc@0.1.87" |
| 168 | + "simple-swizzle@0.2.3" |
| 169 | + "slice-ansi@7.1.1" |
| 170 | + "strip-ansi@7.1.1" |
| 171 | + "supports-color@10.2.1" |
| 172 | + "supports-hyperlinks@4.1.1" |
| 173 | + "wrap-ansi@9.0.1" |
| 174 | + ) |
| 175 | +
|
| 176 | + for vuln in "${vulns[@]}"; do |
| 177 | + if [[ -n $(npm ls --depth=99 --parseable "$vuln") ]]; then |
| 178 | + echo "VULNERABILITY FOUND: $vuln" |
| 179 | + exit 1 |
| 180 | + else |
| 181 | + echo "Known vulnerability not found: $vuln" |
| 182 | + fi |
| 183 | + done |
| 184 | +
|
| 185 | + # Known string from the exploit |
| 186 | + # https://github.com/chalk/chalk/issues/656#issuecomment-3266880534 |
| 187 | + strings=( |
| 188 | + "_0x112fa8" |
| 189 | + ) |
| 190 | +
|
| 191 | + for str in "${strings[@]}"; do |
| 192 | + if grep -r "$str" --include='*.js' .; then |
| 193 | + echo "VULNERABILITY FOUND: string '$str' found in js files" |
| 194 | + exit 1 |
| 195 | + else |
| 196 | + echo "String '$str' not found in js files" |
| 197 | + fi |
| 198 | + done |
134 | 199 | - run: $INPUTS_PACKAGE_MANAGER run build |
135 | 200 | - run: npm install -g @salesforce/plugin-release-management |
136 | 201 | - name: NPM Release |
|
0 commit comments