@socketsecurity/cli-with-sentry 1.10.1 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [1.11.0](https://github.com/SocketDev/socket-cli/releases/tag/v1.11.0) - 2026-10-26
8
+
9
+ ### Added
10
+ - `socket scan create --reach` and `socket scan reach` take `--reach-advisories` to focus reachability analysis on the GHSA or CVE advisories you care about. Every other advisory is left with unknown reachability.
11
+
12
+ ### Changed
13
+ - Updated the Coana CLI to v `15.13.0`.
14
+
7
15
  ## [1.10.1](https://github.com/SocketDev/socket-cli/releases/tag/v1.10.1) - 2026-10-23
8
16
 
9
17
  ### Changed
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Socket CLI
2
2
 
3
3
  [![Socket Badge](https://socket.dev/api/badge/npm/package/socket)](https://socket.dev/npm/package/socket)
4
- [![Follow @SocketSecurity](https://raw.githubusercontent.com/SocketDev/socket-cli/v1.10.1/assets/fleet/badge-follow-x.svg)](https://twitter.com/SocketSecurity)
5
- [![Follow @socket.dev on Bluesky](https://raw.githubusercontent.com/SocketDev/socket-cli/v1.10.1/assets/fleet/badge-follow-bluesky.svg)](https://bsky.app/profile/socket.dev)
4
+ [![Follow @SocketSecurity](https://raw.githubusercontent.com/SocketDev/socket-cli/v1.11.0/assets/fleet/badge-follow-x.svg)](https://twitter.com/SocketSecurity)
5
+ [![Follow @socket.dev on Bluesky](https://raw.githubusercontent.com/SocketDev/socket-cli/v1.11.0/assets/fleet/badge-follow-bluesky.svg)](https://bsky.app/profile/socket.dev)
6
6
 
7
7
  CLI for [Socket.dev](https://socket.dev) — scan dependencies, audit packages, apply security patches, and gate installs from your terminal or CI. This is the 1.x line of the published `socket` package on npm.
8
8
 
@@ -170,8 +170,8 @@ MIT
170
170
  <br/>
171
171
  <div align="center">
172
172
  <picture>
173
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.10.1/assets/fleet/socket-combomark-dark.svg">
174
- <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.10.1/assets/fleet/socket-combomark-light.svg">
175
- <img width="324" height="104" alt="Socket" src="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.10.1/assets/fleet/socket-combomark-light.svg">
173
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.11.0/assets/fleet/socket-combomark-dark.svg">
174
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.11.0/assets/fleet/socket-combomark-light.svg">
175
+ <img width="324" height="104" alt="Socket" src="https://raw.githubusercontent.com/SocketDev/socket-cli/v1.11.0/assets/fleet/socket-combomark-light.svg">
176
176
  </picture>
177
177
  </div>
package/dist/cli.js CHANGED
@@ -2010,7 +2010,7 @@ async function performReachabilityAnalysis(options) {
2010
2010
  // Build Coana arguments.
2011
2011
  const coanaArgs = ['run', analysisTarget, '--output-dir', path.dirname(outputFilePath), '--socket-mode', outputFilePath, '--disable-report-submission', ...(isOmittedReachValue(reachabilityOptions.reachAnalysisTimeout) ? [] : ['--analysis-timeout', reachabilityOptions.reachAnalysisTimeout]), ...(isOmittedReachValue(reachabilityOptions.reachAnalysisMemoryLimit) ? [] : ['--memory-limit', reachabilityOptions.reachAnalysisMemoryLimit]), ...(reachabilityOptions.reachConcurrency ? ['--concurrency', `${reachabilityOptions.reachConcurrency}`] : []), ...(reachabilityOptions.reachContinueOnAnalysisErrors ? ['--reach-continue-on-analysis-errors'] : []), ...(reachabilityOptions.reachContinueOnInstallErrors ? ['--reach-continue-on-install-errors'] : []), ...(reachabilityOptions.reachContinueOnMissingLockFiles ? ['--reach-continue-on-missing-lock-files'] : []), ...(reachabilityOptions.reachContinueOnNoSourceFiles ? ['--reach-continue-on-no-source-files'] : []), ...(reachabilityOptions.reachDebug ? ['--debug'] : []), ...(reachabilityOptions.reachDetailedAnalysisLogFile ? ['--print-analysis-log-file'] : []), ...(reachabilityOptions.reachDisableAnalytics ? ['--disable-analytics-sharing'] : []), ...(reachabilityOptions.reachDisableExternalToolChecks ? ['--disable-external-tool-checks'] : []), ...(reachabilityOptions.reachEnableAnalysisSplitting ? [] : ['--disable-analysis-splitting']), '--run-without-docker', '--manifests-tar-hash', tarHash,
2012
2012
  // Empty reachEcosystems implies scanning all ecosystems.
2013
- ...(reachabilityOptions.reachEcosystems.length ? ['--purl-types', ...reachabilityOptions.reachEcosystems] : []), ...(reachabilityOptions.reachExcludePaths.length ? ['--exclude-dirs', ...reachabilityOptions.reachExcludePaths] : []),
2013
+ ...(reachabilityOptions.reachEcosystems.length ? ['--purl-types', ...reachabilityOptions.reachEcosystems] : []), ...(reachabilityOptions.reachAdvisories.length ? ['--ghsas', ...reachabilityOptions.reachAdvisories] : []), ...(reachabilityOptions.reachExcludePaths.length ? ['--exclude-dirs', ...reachabilityOptions.reachExcludePaths] : []),
2014
2014
  // sidecarPath is always set above when this is true - Coana rejects this
2015
2015
  // flag without one.
2016
2016
  ...(reachabilityOptions.dynamicSbomInference ? ['--maven-use-only-socket-facts'] : []), ...(reachabilityOptions.reachSkipCache ? ['--skip-cache-usage'] : []), ...(reachabilityOptions.reachUseOnlyPregeneratedSboms ? ['--use-only-pregenerated-sboms'] : []), ...(sidecarPath ? ['--compute-artifacts-sidecar', sidecarPath] : [])];
@@ -7806,6 +7806,7 @@ async function handleCi(autoManifest) {
7806
7806
  reach: {
7807
7807
  dynamicSbomInference: false,
7808
7808
  excludePaths: [],
7809
+ reachAdvisories: [],
7809
7810
  reachAnalysisMemoryLimit: '',
7810
7811
  reachAnalysisTimeout: '',
7811
7812
  reachConcurrency: 1,
@@ -9934,8 +9935,6 @@ async function outputFixResult(result, outputKind) {
9934
9935
  logger.logger.success('Finished!');
9935
9936
  }
9936
9937
 
9937
- const GHSA_FORMAT_REGEXP = /^GHSA-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}$/;
9938
- const CVE_FORMAT_REGEXP = /^CVE-\d{4}-\d{4,}$/;
9939
9938
  /**
9940
9939
  * Converts mixed CVE/GHSA/PURL IDs to GHSA IDs only.
9941
9940
  * Filters out invalid IDs and logs conversion results.
@@ -9951,51 +9950,12 @@ async function convertIdsToGhsas(ids, options) {
9951
9950
  debug.debugDir('inspect', {
9952
9951
  ids
9953
9952
  });
9954
- const validGhsas = [];
9955
- const errors = [];
9956
- for (const id of ids) {
9957
- const trimmedId = id.trim();
9958
- if (trimmedId.startsWith('GHSA-')) {
9959
- // Already a GHSA ID, validate format
9960
- if (GHSA_FORMAT_REGEXP.test(trimmedId)) {
9961
- validGhsas.push(trimmedId);
9962
- } else {
9963
- errors.push(`Invalid GHSA format: ${trimmedId}`);
9964
- }
9965
- } else if (trimmedId.startsWith('CVE-')) {
9966
- // Convert CVE to GHSA
9967
- if (!CVE_FORMAT_REGEXP.test(trimmedId)) {
9968
- errors.push(`Invalid CVE format: ${trimmedId}`);
9969
- continue;
9970
- }
9971
-
9972
- // eslint-disable-next-line no-await-in-loop
9973
- const conversionResult = await utils.convertCveToGhsa(trimmedId);
9974
- if (conversionResult.ok) {
9975
- validGhsas.push(conversionResult.data);
9976
- if (!silence) {
9977
- logger.logger.info(`Converted ${trimmedId} to ${conversionResult.data}`);
9978
- }
9979
- } else {
9980
- errors.push(`${trimmedId}: ${conversionResult.message}`);
9981
- }
9982
- } else if (trimmedId.startsWith('pkg:')) {
9983
- // Convert PURL to GHSAs.
9984
- // eslint-disable-next-line no-await-in-loop
9985
- const conversionResult = await utils.convertPurlToGhsas(trimmedId);
9986
- if (conversionResult.ok && conversionResult.data.length) {
9987
- validGhsas.push(...conversionResult.data);
9988
- if (!silence) {
9989
- logger.logger.info(`Converted ${trimmedId} to ${conversionResult.data.length} GHSA(s): ${arrays.joinAnd(conversionResult.data)}`);
9990
- }
9991
- } else {
9992
- errors.push(`${trimmedId}: ${conversionResult.message || 'No GHSAs found'}`);
9993
- }
9994
- } else {
9995
- // Neither CVE, GHSA, nor PURL, skip
9996
- errors.push(`Unsupported ID format (expected CVE, GHSA, or PURL): ${trimmedId}`);
9997
- }
9998
- }
9953
+ const {
9954
+ errors,
9955
+ ghsas: validGhsas
9956
+ } = await utils.resolveAdvisoryIds(ids, {
9957
+ silence
9958
+ });
9999
9959
  if (errors.length) {
10000
9960
  if (!silence) {
10001
9961
  logger.logger.warn(`Skipped ${errors.length} invalid IDs:\n${errors.map(e => ` - ${e}`).join('\n')}`);
@@ -10112,6 +10072,11 @@ const reachabilityFlags = {
10112
10072
  type: 'string',
10113
10073
  description: `Override the version of @coana-tech/cli used for reachability analysis. Default: ${constants.COANA_CLI_VERSION}.`
10114
10074
  },
10075
+ reachAdvisories: {
10076
+ type: 'string',
10077
+ isMultiple: true,
10078
+ description: 'List of advisories to run reachability analysis for, as GHSA or CVE IDs, either as a comma separated value or as multiple flags. CVE IDs are converted to GHSA IDs through the GitHub API. Vulnerabilities from other advisories get unknown reachability. Defaults to all advisories.'
10079
+ },
10115
10080
  reachAnalysisMemoryLimit: {
10116
10081
  type: 'string',
10117
10082
  default: '8192',
@@ -20058,6 +20023,37 @@ function resolveUvMemberDirs(targets, cwd) {
20058
20023
  return Array.from(memberDirs);
20059
20024
  }
20060
20025
 
20026
+ // GitHub publishes GHSA IDs with a lowercase body and CVE IDs uppercase.
20027
+ function normalizeAdvisoryId(id) {
20028
+ const trimmed = id.trim();
20029
+ return /^ghsa-/i.test(trimmed) ? `GHSA-${trimmed.slice(5).toLowerCase()}` : trimmed.toUpperCase();
20030
+ }
20031
+
20032
+ /**
20033
+ * Resolves the --reach-advisories IDs to GHSA IDs, converting CVE IDs through
20034
+ * the GitHub API. Any ID that cannot be resolved fails the command, since
20035
+ * dropping it would leave that advisory without reachability analysis.
20036
+ */
20037
+ async function resolveReachAdvisories(ids) {
20038
+ const normalizedIds = arrays.arrayUnique(ids.map(normalizeAdvisoryId));
20039
+ // Checked up front so PURLs never reach resolveAdvisoryIds and a typo fails
20040
+ // before any GitHub lookup.
20041
+ const invalidIds = normalizedIds.filter(id => !utils.GHSA_FORMAT_REGEXP.test(id) && !utils.CVE_FORMAT_REGEXP.test(id));
20042
+ if (invalidIds.length) {
20043
+ throw new utils.InputError(`Invalid --reach-advisories IDs: ${invalidIds.join(', ')}. Use GHSA IDs (GHSA-xxxx-xxxx-xxxx) or CVE IDs (CVE-YYYY-NNNN).`);
20044
+ }
20045
+ const {
20046
+ errors,
20047
+ ghsas
20048
+ } = await utils.resolveAdvisoryIds(normalizedIds, {
20049
+ silence: true
20050
+ });
20051
+ if (errors.length) {
20052
+ throw new utils.InputError(`Could not resolve --reach-advisories IDs to GHSA IDs:\n${errors.map(e => ` - ${e}`).join('\n')}`);
20053
+ }
20054
+ return arrays.arrayUnique(ghsas);
20055
+ }
20056
+
20061
20057
  async function suggestTarget() {
20062
20058
  // We could prefill this with sub-dirs of the current
20063
20059
  // dir ... but is that going to be useful?
@@ -20487,8 +20483,10 @@ async function run$d(argv, importMeta, {
20487
20483
  const excludePaths = utils.cmdFlagValueToArray(cli.flags['excludePaths']);
20488
20484
  assertValidExcludePaths(excludePaths);
20489
20485
  const reachExcludePaths = utils.cmdFlagValueToArray(cli.flags['reachExcludePaths']);
20486
+ const reachAdvisoriesRaw = utils.cmdFlagValueToArray(cli.flags['reachAdvisories']);
20490
20487
 
20491
20488
  // Validation helpers for better readability.
20489
+ const hasReachAdvisories = reachAdvisoriesRaw.length > 0;
20492
20490
  const hasReachEcosystems = reachEcosystems.length > 0;
20493
20491
  const hasReachExcludePaths = reachExcludePaths.length > 0;
20494
20492
 
@@ -20506,7 +20504,7 @@ async function run$d(argv, importMeta, {
20506
20504
  // added flags require --reach automatically instead of relying on a
20507
20505
  // hand-maintained list. Deprecated no-ops are excluded on purpose.
20508
20506
  const isUsingAnyBooleanReachFlag = Object.entries(reachabilityFlags).some(([name, flag]) => flag.type === 'boolean' && !DEPRECATED_NO_OP_REACH_FLAGS.has(name) && cli.flags[name] !== flag.default);
20509
- const isUsingAnyReachabilityFlags = hasReachEcosystems || hasReachExcludePaths || isUsingAnyBooleanReachFlag || isUsingNonDefaultConcurrency || isUsingNonDefaultMemoryLimit || isUsingNonDefaultTimeout || isUsingNonDefaultVersion;
20507
+ const isUsingAnyReachabilityFlags = hasReachAdvisories || hasReachEcosystems || hasReachExcludePaths || isUsingAnyBooleanReachFlag || isUsingNonDefaultConcurrency || isUsingNonDefaultMemoryLimit || isUsingNonDefaultTimeout || isUsingNonDefaultVersion;
20510
20508
 
20511
20509
  // Validate target constraints when --reach is enabled.
20512
20510
  const reachTargetValidation = reach ? await validateReachabilityTarget(targets, cwd) : {
@@ -20583,6 +20581,7 @@ async function run$d(argv, importMeta, {
20583
20581
  logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
20584
20582
  return;
20585
20583
  }
20584
+ const reachAdvisories = await resolveReachAdvisories(reachAdvisoriesRaw);
20586
20585
  await handleCreateNewScan({
20587
20586
  autoManifest: Boolean(autoManifest),
20588
20587
  branchName: branchName,
@@ -20600,6 +20599,7 @@ async function run$d(argv, importMeta, {
20600
20599
  reach: {
20601
20600
  dynamicSbomInference: Boolean(dynamicSbomInference),
20602
20601
  excludePaths,
20602
+ reachAdvisories,
20603
20603
  reachAnalysisMemoryLimit,
20604
20604
  reachAnalysisTimeout,
20605
20605
  reachConcurrency: Number(reachConcurrency),
@@ -21318,6 +21318,7 @@ async function scanOneRepo(repoSlug, {
21318
21318
  reach: {
21319
21319
  dynamicSbomInference: false,
21320
21320
  excludePaths: [],
21321
+ reachAdvisories: [],
21321
21322
  reachAnalysisMemoryLimit: '',
21322
21323
  reachAnalysisTimeout: '',
21323
21324
  reachConcurrency: 1,
@@ -22746,6 +22747,7 @@ async function run$7(argv, importMeta, {
22746
22747
 
22747
22748
  // Process comma-separated values for isMultiple flags.
22748
22749
  const excludePaths = utils.cmdFlagValueToArray(cli.flags['excludePaths']);
22750
+ const reachAdvisoriesRaw = utils.cmdFlagValueToArray(cli.flags['reachAdvisories']);
22749
22751
  const reachEcosystemsRaw = utils.cmdFlagValueToArray(cli.flags['reachEcosystems']);
22750
22752
  const reachExcludePaths = utils.cmdFlagValueToArray(cli.flags['reachExcludePaths']);
22751
22753
  assertValidExcludePaths(excludePaths);
@@ -22818,6 +22820,7 @@ async function run$7(argv, importMeta, {
22818
22820
  logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
22819
22821
  return;
22820
22822
  }
22823
+ const reachAdvisories = await resolveReachAdvisories(reachAdvisoriesRaw);
22821
22824
  await handleScanReach({
22822
22825
  cwd,
22823
22826
  interactive,
@@ -22827,6 +22830,7 @@ async function run$7(argv, importMeta, {
22827
22830
  reachabilityOptions: {
22828
22831
  dynamicSbomInference: Boolean(dynamicSbomInference),
22829
22832
  excludePaths,
22833
+ reachAdvisories,
22830
22834
  reachAnalysisMemoryLimit,
22831
22835
  reachAnalysisTimeout,
22832
22836
  reachConcurrency: Number(reachConcurrency),
@@ -24791,5 +24795,5 @@ process.on('unhandledRejection', async (reason, promise) => {
24791
24795
  // eslint-disable-next-line n/no-process-exit
24792
24796
  process.exit(1);
24793
24797
  });
24794
- //# debugId=3195b2a9-2bce-44ed-8eea-bd5e763d40fa
24798
+ //# debugId=5d7a85dd-501f-4419-b550-bef90180bd6a
24795
24799
  //# sourceMappingURL=cli.js.map