snyk 1.1003.0 → 1.1005.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.
@@ -14527,7 +14527,7 @@ class NeedleWrapperException extends Error {
14527
14527
 
14528
14528
  Object.defineProperty(exports, "__esModule", ({ value: true }));
14529
14529
  exports.buildUnauthenticatedV2RequestConfig = exports.parseChallengeHeaders = exports.getToken = exports.paginatedV2Call = exports.registryCall = exports.registryV2Call = void 0;
14530
- const parseLink = __webpack_require__(54336);
14530
+ const parseLink = __webpack_require__(28490);
14531
14531
  const url = __webpack_require__(78835);
14532
14532
  const needle_1 = __webpack_require__(48360);
14533
14533
  const BEARER_REALM = "Bearer realm";
@@ -14806,86 +14806,6 @@ function isRedirectStatus(statusCode) {
14806
14806
  Object.defineProperty(exports, "__esModule", ({ value: true }));
14807
14807
  //# sourceMappingURL=types.js.map
14808
14808
 
14809
- /***/ }),
14810
-
14811
- /***/ 54336:
14812
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
14813
-
14814
- "use strict";
14815
-
14816
-
14817
- var qs = __webpack_require__(71191)
14818
- , url = __webpack_require__(78835)
14819
- , xtend = __webpack_require__(47529);
14820
-
14821
- const PARSE_LINK_HEADER_MAXLEN = parseInt(process.env.PARSE_LINK_HEADER_MAXLEN) || 2000;
14822
- const PARSE_LINK_HEADER_THROW_ON_MAXLEN_EXCEEDED = process.env.PARSE_LINK_HEADER_THROW_ON_MAXLEN_EXCEEDED != null
14823
-
14824
- function hasRel(x) {
14825
- return x && x.rel;
14826
- }
14827
-
14828
- function intoRels (acc, x) {
14829
- function splitRel (rel) {
14830
- acc[rel] = xtend(x, { rel: rel });
14831
- }
14832
-
14833
- x.rel.split(/\s+/).forEach(splitRel);
14834
-
14835
- return acc;
14836
- }
14837
-
14838
- function createObjects (acc, p) {
14839
- // rel="next" => 1: rel 2: next
14840
- var m = p.match(/\s*(.+)\s*=\s*"?([^"]+)"?/)
14841
- if (m) acc[m[1]] = m[2];
14842
- return acc;
14843
- }
14844
-
14845
- function parseLink(link) {
14846
- try {
14847
- var m = link.match(/<?([^>]*)>(.*)/)
14848
- , linkUrl = m[1]
14849
- , parts = m[2].split(';')
14850
- , parsedUrl = url.parse(linkUrl)
14851
- , qry = qs.parse(parsedUrl.query);
14852
-
14853
- parts.shift();
14854
-
14855
- var info = parts
14856
- .reduce(createObjects, {});
14857
-
14858
- info = xtend(qry, info);
14859
- info.url = linkUrl;
14860
- return info;
14861
- } catch (e) {
14862
- return null;
14863
- }
14864
- }
14865
-
14866
- function checkHeader(linkHeader){
14867
- if (!linkHeader) return false;
14868
-
14869
- if (linkHeader.length > PARSE_LINK_HEADER_MAXLEN) {
14870
- if (PARSE_LINK_HEADER_THROW_ON_MAXLEN_EXCEEDED) {
14871
- throw new Error('Input string too long, it should be under ' + PARSE_LINK_HEADER_MAXLEN + ' characters.');
14872
- } else {
14873
- return false;
14874
- }
14875
- }
14876
- return true;
14877
- }
14878
-
14879
- module.exports = function (linkHeader) {
14880
- if (!checkHeader(linkHeader)) return null;
14881
-
14882
- return linkHeader.split(/,\s*</)
14883
- .map(parseLink)
14884
- .filter(hasRel)
14885
- .reduce(intoRels, {});
14886
- };
14887
-
14888
-
14889
14809
  /***/ }),
14890
14810
 
14891
14811
  /***/ 8381:
@@ -147805,6 +147725,86 @@ module.exports = pTry;
147805
147725
  module.exports.default = pTry;
147806
147726
 
147807
147727
 
147728
+ /***/ }),
147729
+
147730
+ /***/ 28490:
147731
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
147732
+
147733
+ "use strict";
147734
+
147735
+
147736
+ var qs = __webpack_require__(71191)
147737
+ , url = __webpack_require__(78835)
147738
+ , xtend = __webpack_require__(47529);
147739
+
147740
+ const PARSE_LINK_HEADER_MAXLEN = parseInt(process.env.PARSE_LINK_HEADER_MAXLEN) || 2000;
147741
+ const PARSE_LINK_HEADER_THROW_ON_MAXLEN_EXCEEDED = process.env.PARSE_LINK_HEADER_THROW_ON_MAXLEN_EXCEEDED != null
147742
+
147743
+ function hasRel(x) {
147744
+ return x && x.rel;
147745
+ }
147746
+
147747
+ function intoRels (acc, x) {
147748
+ function splitRel (rel) {
147749
+ acc[rel] = xtend(x, { rel: rel });
147750
+ }
147751
+
147752
+ x.rel.split(/\s+/).forEach(splitRel);
147753
+
147754
+ return acc;
147755
+ }
147756
+
147757
+ function createObjects (acc, p) {
147758
+ // rel="next" => 1: rel 2: next
147759
+ var m = p.match(/\s*(.+)\s*=\s*"?([^"]+)"?/)
147760
+ if (m) acc[m[1]] = m[2];
147761
+ return acc;
147762
+ }
147763
+
147764
+ function parseLink(link) {
147765
+ try {
147766
+ var m = link.match(/<?([^>]*)>(.*)/)
147767
+ , linkUrl = m[1]
147768
+ , parts = m[2].split(';')
147769
+ , parsedUrl = url.parse(linkUrl)
147770
+ , qry = qs.parse(parsedUrl.query);
147771
+
147772
+ parts.shift();
147773
+
147774
+ var info = parts
147775
+ .reduce(createObjects, {});
147776
+
147777
+ info = xtend(qry, info);
147778
+ info.url = linkUrl;
147779
+ return info;
147780
+ } catch (e) {
147781
+ return null;
147782
+ }
147783
+ }
147784
+
147785
+ function checkHeader(linkHeader){
147786
+ if (!linkHeader) return false;
147787
+
147788
+ if (linkHeader.length > PARSE_LINK_HEADER_MAXLEN) {
147789
+ if (PARSE_LINK_HEADER_THROW_ON_MAXLEN_EXCEEDED) {
147790
+ throw new Error('Input string too long, it should be under ' + PARSE_LINK_HEADER_MAXLEN + ' characters.');
147791
+ } else {
147792
+ return false;
147793
+ }
147794
+ }
147795
+ return true;
147796
+ }
147797
+
147798
+ module.exports = function (linkHeader) {
147799
+ if (!checkHeader(linkHeader)) return null;
147800
+
147801
+ return linkHeader.split(/,\s*</)
147802
+ .map(parseLink)
147803
+ .filter(hasRel)
147804
+ .reduce(intoRels, {});
147805
+ };
147806
+
147807
+
147808
147808
  /***/ }),
147809
147809
 
147810
147810
  /***/ 29847:
@@ -159273,8 +159273,13 @@ class GoBinary {
159273
159273
  constructor(goElfBinary) {
159274
159274
  [this.name, this.modules] = extractModuleInformation(goElfBinary);
159275
159275
  const pclnTab = goElfBinary.body.sections.find((section) => section.name === ".gopclntab");
159276
+ // some CGo built binaries might not contain a pclnTab, which means we
159277
+ // cannot scan the files.
159278
+ // TODO: from a technical perspective, it would be enough to only report the
159279
+ // modules, as the only remediation path is to upgrade a full module
159280
+ // anyways. From a product perspective, it's not clear (yet).
159276
159281
  if (pclnTab === undefined) {
159277
- throw Error("no pcln table found in Go binary");
159282
+ throw Error("no pcln table present in Go binary");
159278
159283
  }
159279
159284
  this.matchFilesToModules(new pclntab_1.LineTable(pclnTab.data).go12MapFiles());
159280
159285
  }
@@ -159626,10 +159631,12 @@ exports.GoModule = GoModule;
159626
159631
 
159627
159632
  Object.defineProperty(exports, "__esModule", ({ value: true }));
159628
159633
  exports.goModulesToScannedProjects = exports.getGoModulesContentAction = exports.DEP_GRAPH_TYPE = void 0;
159634
+ const Debug = __webpack_require__(15158);
159629
159635
  const elf = __webpack_require__(18);
159630
159636
  const event_loop_spinner_1 = __webpack_require__(77158);
159631
159637
  const path = __webpack_require__(85622);
159632
159638
  const go_binary_1 = __webpack_require__(6803);
159639
+ const debug = Debug("snyk");
159633
159640
  const ignoredPaths = [
159634
159641
  path.normalize("/boot"),
159635
159642
  path.normalize("/dev"),
@@ -159743,21 +159750,26 @@ async function goModulesToScannedProjects(filePathToContent) {
159743
159750
  if (event_loop_spinner_1.eventLoopSpinner.isStarving()) {
159744
159751
  await event_loop_spinner_1.eventLoopSpinner.spin();
159745
159752
  }
159746
- const depGraph = await new go_binary_1.GoBinary(goBinary).depGraph();
159747
- if (!depGraph) {
159748
- continue;
159753
+ try {
159754
+ const depGraph = await new go_binary_1.GoBinary(goBinary).depGraph();
159755
+ if (!depGraph) {
159756
+ continue;
159757
+ }
159758
+ const depGraphFact = {
159759
+ type: "depGraph",
159760
+ data: depGraph,
159761
+ };
159762
+ scanResults.push({
159763
+ facts: [depGraphFact],
159764
+ identity: {
159765
+ type: exports.DEP_GRAPH_TYPE,
159766
+ targetFile: filePath,
159767
+ },
159768
+ });
159769
+ }
159770
+ catch (err) {
159771
+ debug(`Go binary scan for file ${filePath} failed: ${err}`);
159749
159772
  }
159750
- const depGraphFact = {
159751
- type: "depGraph",
159752
- data: depGraph,
159753
- };
159754
- scanResults.push({
159755
- facts: [depGraphFact],
159756
- identity: {
159757
- type: exports.DEP_GRAPH_TYPE,
159758
- targetFile: filePath,
159759
- },
159760
- });
159761
159773
  }
159762
159774
  return scanResults;
159763
159775
  }