Skip to content

Commit

Permalink
Continued typing edits
Browse files Browse the repository at this point in the history
Signed-off-by: Charles Hu <[email protected]>
  • Loading branch information
charleshu-8 committed Aug 13, 2024
1 parent cd74818 commit 39480e3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"title": "com.fasterxml.jackson.core:jackson-databind is a library which contains the general-purpose data-binding functionality and tree-model for Jackson Data Processor.\n\nAffected versions of this package are vulnerable to XML External Entity (XXE) Injection. A flaw was found in FasterXML Jackson Databind, where it does not have entity expansion secured properly in the DOMDeserializer class. The highest threat from this vulnerability is data integrity.",
"id": "CVE-2020-25649",
"desc": "com.fasterxml.jackson.core:jackson-databind is a library which contains the general-purpose data-binding functionality and tree-model for Jackson Data Processor.\n\nAffected versions of this package are vulnerable to XML External Entity (XXE) Injection. A flaw was found in FasterXML Jackson Databind, where it does not have entity expansion secured properly in the DOMDeserializer class. The highest threat from this vulnerability is data integrity.",
"impact": 0.82,
"impact": 0,
"code": "{\n \"id\": \"CVE-2020-25649\",\n \"source\": {\n \"name\": \"NVD\",\n \"url\": \"https://nvd.nist.gov/vuln/detail/CVE-2020-25649\"\n },\n \"references\": [\n {\n \"id\": \"SNYK-JAVA-COMFASTERXMLJACKSONCORE-1048302\",\n \"source\": {\n \"name\": \"SNYK\",\n \"url\": \"https://security.snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1048302\"\n }\n }\n ],\n \"ratings\": [\n {\n \"source\": {\n \"name\": \"NVD\",\n \"url\": \"https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N&version=3.1\"\n },\n \"score\": 7.5,\n \"severity\": \"high\",\n \"method\": \"CVSSv31\",\n \"vector\": \"AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N\"\n },\n {\n \"source\": {\n \"name\": \"SNYK\",\n \"url\": \"https://security.snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1048302\"\n },\n \"score\": 8.2,\n \"severity\": \"high\",\n \"method\": \"CVSSv31\",\n \"vector\": \"AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N\"\n },\n {\n \"source\": {\n \"name\": \"Acme Inc\",\n \"url\": \"https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N/CR:X/IR:X/AR:X/MAV:X/MAC:X/MPR:X/MUI:X/MS:X/MC:N/MI:N/MA:N&version=3.1\"\n },\n \"score\": 0,\n \"severity\": \"none\",\n \"method\": \"CVSSv31\",\n \"vector\": \"AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N/CR:X/IR:X/AR:X/MAV:X/MAC:X/MPR:X/MUI:X/MS:X/MC:N/MI:N/MA:N\"\n }\n ],\n \"cwes\": [\n 611\n ],\n \"description\": \"com.fasterxml.jackson.core:jackson-databind is a library which contains the general-purpose data-binding functionality and tree-model for Jackson Data Processor.\\n\\nAffected versions of this package are vulnerable to XML External Entity (XXE) Injection. A flaw was found in FasterXML Jackson Databind, where it does not have entity expansion secured properly in the DOMDeserializer class. The highest threat from this vulnerability is data integrity.\",\n \"detail\": \"XXE Injection is a type of attack against an application that parses XML input. XML is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. By default, many XML processors allow specification of an external entity, a URI that is dereferenced and evaluated during XML processing. When an XML document is being parsed, the parser can make a request and include the content at the specified URI inside of the XML document.\\n\\nAttacks can include disclosing local files, which may contain sensitive data such as passwords or private user data, using file: schemes or relative paths in the system identifier.\",\n \"recommendation\": \"Upgrade com.fasterxml.jackson.core:jackson-databind to version 2.6.7.4, 2.9.10.7, 2.10.5.1 or higher.\",\n \"advisories\": [\n {\n \"title\": \"GitHub Commit\",\n \"url\": \"https://github.com/FasterXML/jackson-databind/commit/612f971b78c60202e9cd75a299050c8f2d724a59\"\n },\n {\n \"title\": \"GitHub Issue\",\n \"url\": \"https://github.com/FasterXML/jackson-databind/issues/2589\"\n },\n {\n \"title\": \"RedHat Bugzilla Bug\",\n \"url\": \"https://bugzilla.redhat.com/show_bug.cgi?id=1887664\"\n }\n ],\n \"created\": \"2020-12-03T00:00:00.000Z\",\n \"published\": \"2020-12-03T00:00:00.000Z\",\n \"updated\": \"2021-10-26T00:00:00.000Z\",\n \"credits\": {\n \"individuals\": [\n {\n \"name\": \"Bartosz Baranowski\"\n }\n ]\n },\n \"analysis\": {\n \"state\": \"not_affected\",\n \"justification\": \"code_not_reachable\",\n \"response\": [\n \"will_not_fix\",\n \"update\"\n ],\n \"detail\": \"Automated dataflow analysis and manual code review indicates that the vulnerable code is not reachable, either directly or indirectly.\"\n },\n \"affects\": [\n {\n \"ref\": \"urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#pkg:maven/com.fasterxml.jackson.core/[email protected]?type=jar\"\n }\n ]\n}",
"results": [
{
Expand All @@ -102,7 +102,7 @@
]
}
],
"sha256": "b15bd8e5f6b7f08dce1e8de61578c821e8b7a42d8d82dcaa8ebb3390667a0759"
"sha256": "1fc25a62c2f831ebe656e348d1aa77c3d6515020aa67a84f73ce97211ba593a7"
}
],
"passthrough": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"title": "com.fasterxml.jackson.core:jackson-databind is a library which contains the general-purpose data-binding functionality and tree-model for Jackson Data Processor.\n\nAffected versions of this package are vulnerable to XML External Entity (XXE) Injection. A flaw was found in FasterXML Jackson Databind, where it does not have entity expansion secured properly in the DOMDeserializer class. The highest threat from this vulnerability is data integrity.",
"id": "CVE-2020-25649",
"desc": "com.fasterxml.jackson.core:jackson-databind is a library which contains the general-purpose data-binding functionality and tree-model for Jackson Data Processor.\n\nAffected versions of this package are vulnerable to XML External Entity (XXE) Injection. A flaw was found in FasterXML Jackson Databind, where it does not have entity expansion secured properly in the DOMDeserializer class. The highest threat from this vulnerability is data integrity.",
"impact": 0.82,
"impact": 0,
"code": "{\n \"id\": \"CVE-2020-25649\",\n \"source\": {\n \"name\": \"NVD\",\n \"url\": \"https://nvd.nist.gov/vuln/detail/CVE-2020-25649\"\n },\n \"references\": [\n {\n \"id\": \"SNYK-JAVA-COMFASTERXMLJACKSONCORE-1048302\",\n \"source\": {\n \"name\": \"SNYK\",\n \"url\": \"https://security.snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1048302\"\n }\n }\n ],\n \"ratings\": [\n {\n \"source\": {\n \"name\": \"NVD\",\n \"url\": \"https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N&version=3.1\"\n },\n \"score\": 7.5,\n \"severity\": \"high\",\n \"method\": \"CVSSv31\",\n \"vector\": \"AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N\"\n },\n {\n \"source\": {\n \"name\": \"SNYK\",\n \"url\": \"https://security.snyk.io/vuln/SNYK-JAVA-COMFASTERXMLJACKSONCORE-1048302\"\n },\n \"score\": 8.2,\n \"severity\": \"high\",\n \"method\": \"CVSSv31\",\n \"vector\": \"AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N\"\n },\n {\n \"source\": {\n \"name\": \"Acme Inc\",\n \"url\": \"https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N/CR:X/IR:X/AR:X/MAV:X/MAC:X/MPR:X/MUI:X/MS:X/MC:N/MI:N/MA:N&version=3.1\"\n },\n \"score\": 0,\n \"severity\": \"none\",\n \"method\": \"CVSSv31\",\n \"vector\": \"AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N/CR:X/IR:X/AR:X/MAV:X/MAC:X/MPR:X/MUI:X/MS:X/MC:N/MI:N/MA:N\"\n }\n ],\n \"cwes\": [\n 611\n ],\n \"description\": \"com.fasterxml.jackson.core:jackson-databind is a library which contains the general-purpose data-binding functionality and tree-model for Jackson Data Processor.\\n\\nAffected versions of this package are vulnerable to XML External Entity (XXE) Injection. A flaw was found in FasterXML Jackson Databind, where it does not have entity expansion secured properly in the DOMDeserializer class. The highest threat from this vulnerability is data integrity.\",\n \"detail\": \"XXE Injection is a type of attack against an application that parses XML input. XML is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. By default, many XML processors allow specification of an external entity, a URI that is dereferenced and evaluated during XML processing. When an XML document is being parsed, the parser can make a request and include the content at the specified URI inside of the XML document.\\n\\nAttacks can include disclosing local files, which may contain sensitive data such as passwords or private user data, using file: schemes or relative paths in the system identifier.\",\n \"recommendation\": \"Upgrade com.fasterxml.jackson.core:jackson-databind to version 2.6.7.4, 2.9.10.7, 2.10.5.1 or higher.\",\n \"advisories\": [\n {\n \"title\": \"GitHub Commit\",\n \"url\": \"https://github.com/FasterXML/jackson-databind/commit/612f971b78c60202e9cd75a299050c8f2d724a59\"\n },\n {\n \"title\": \"GitHub Issue\",\n \"url\": \"https://github.com/FasterXML/jackson-databind/issues/2589\"\n },\n {\n \"title\": \"RedHat Bugzilla Bug\",\n \"url\": \"https://bugzilla.redhat.com/show_bug.cgi?id=1887664\"\n }\n ],\n \"created\": \"2020-12-03T00:00:00.000Z\",\n \"published\": \"2020-12-03T00:00:00.000Z\",\n \"updated\": \"2021-10-26T00:00:00.000Z\",\n \"credits\": {\n \"individuals\": [\n {\n \"name\": \"Bartosz Baranowski\"\n }\n ]\n },\n \"analysis\": {\n \"state\": \"not_affected\",\n \"justification\": \"code_not_reachable\",\n \"response\": [\n \"will_not_fix\",\n \"update\"\n ],\n \"detail\": \"Automated dataflow analysis and manual code review indicates that the vulnerable code is not reachable, either directly or indirectly.\"\n },\n \"affects\": [\n {\n \"ref\": \"urn:cdx:3e671687-395b-41f5-a30f-a58921a69b79/1#pkg:maven/com.fasterxml.jackson.core/[email protected]?type=jar\"\n }\n ]\n}",
"results": [
{
Expand All @@ -102,7 +102,7 @@
]
}
],
"sha256": "b15bd8e5f6b7f08dce1e8de61578c821e8b7a42d8d82dcaa8ebb3390667a0759"
"sha256": "1fc25a62c2f831ebe656e348d1aa77c3d6515020aa67a84f73ce97211ba593a7"
}
],
"passthrough": {
Expand Down
38 changes: 28 additions & 10 deletions libs/hdf-converters/src/cyclonedx-sbom-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function maxImpact(ratings: RatingRepository): number {
let impact = 0;
for (const rating of ratings) {
// Prefer to use CVSS-based `score` field when possible
if (rating.score && _.get(rating, 'method') == 'CVSSv31') {
if (rating.score && _.get(rating, 'method') === 'CVSSv31') {
impact = rating.score / 10 > impact ? rating.score / 10 : impact;
} else {
// Else interpret it from `severity` field
Expand Down Expand Up @@ -275,18 +275,19 @@ export class CycloneDXSBOMMapper extends BaseConverter {
maintainer: {
path: 'raw.metadata.component',
transformer: (input: Component): string | undefined => {
// Find organization of authors if possible
const manufacturer = _.has(input, 'manufacturer')
? ` (${(input.manufacturer as Record<string, unknown>).name})`
: '';
// Check through every single possible field which may hold ownership over this component
if (input.author) {
// `author` is deprecated in v1.6 but may still appear
return `${input.author}`;
} else if (_.has(input, 'authors')) {
if (_.has(input, 'authors')) {
// Join list of component authors
return (input.authors as Record<string, unknown>[])
.map((author) => author.name)
.map((author) => `${author.name}${manufacturer}`)
.join(', ');
} else if (_.has(input, 'manufacturer')) {
// If we can't pinpoint the exact authors, resort to the organization
return `${(input.manufacturer as Record<string, unknown>).name}`;
} else if (input.author) {
// `author` is deprecated in v1.6 but may still appear
return `${input.author}${manufacturer}`;
} else {
return undefined;
}
Expand Down Expand Up @@ -430,7 +431,24 @@ export class CycloneDXSBOMMapper extends BaseConverter {
path: 'description',
transformer: filterString
},
impact: {path: 'ratings', transformer: maxImpact},
impact: {
transformer: (input: Vulnerability): number => {
// The `rejected` and `analysis` field may contain information on whether this vulnerability is impactful
if (
_.has(input, 'rejected') ||
[
'resolved',
'resolved_with_pedigree',
'false_positive',
'not_affected'
].includes(_.get(input.analysis, 'state') as string)
) {
return 0;
} else {
return maxImpact(input.ratings);
}
}
},
code: {
transformer: (vulnerability: Record<string, unknown>): string =>
JSON.stringify(
Expand Down

0 comments on commit 39480e3

Please sign in to comment.