Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 52 additions & 22 deletions chrome/extension/js/generated/retire-chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -1873,12 +1873,27 @@ module.exports={
"info": [
"http://blog.jquery.com/2016/01/08/jquery-2-2-and-1-12-released/",
"http://research.insecurelabs.org/jquery/test/",
"https://bugs.jquery.com/ticket/11974",
"https://github.com/advisories/GHSA-rmxg-73gg-4p98",
"https://github.com/jquery/jquery/issues/2432",
"https://nvd.nist.gov/vuln/detail/CVE-2015-9251"
]
},
{
"atOrAbove": "1.8.0",
"below": "2.2.0",
"cwe": [
"CWE-79"
],
"severity": "medium",
"identifiers": {
"summary": "parseHTML() executes scripts in event handlers",
"issue": "11974"
},
"info": [
"http://research.insecurelabs.org/jquery/test/",
"https://bugs.jquery.com/ticket/11974"
]
},
{
"below": "2.999.999",
"cwe": [
Expand Down Expand Up @@ -1912,12 +1927,27 @@ module.exports={
"info": [
"http://blog.jquery.com/2016/01/08/jquery-2-2-and-1-12-released/",
"http://research.insecurelabs.org/jquery/test/",
"https://bugs.jquery.com/ticket/11974",
"https://github.com/advisories/GHSA-rmxg-73gg-4p98",
"https://github.com/jquery/jquery/issues/2432",
"https://nvd.nist.gov/vuln/detail/CVE-2015-9251"
]
},
{
"atOrAbove": "2.2.2",
"below": "3.0.0",
"cwe": [
"CWE-79"
],
"severity": "medium",
"identifiers": {
"summary": "parseHTML() executes scripts in event handlers",
"issue": "11974"
},
"info": [
"http://research.insecurelabs.org/jquery/test/",
"https://bugs.jquery.com/ticket/11974"
]
},
{
"atOrAbove": "3.0.0-rc.1",
"below": "3.0.0",
Expand Down Expand Up @@ -5226,6 +5256,25 @@ module.exports={
"https://www.herodevs.com/vulnerability-directory/cve-2024-8372"
]
},
{
"atOrAbove": "1.7.0",
"below": "1.8.8",
"severity": "medium",
"cwe": [
"CWE-1333",
"CWE-770"
],
"identifiers": {
"summary": "angular vulnerable to regular expression denial of service (ReDoS)",
"CVE": [
"CVE-2022-25844"
],
"githubID": "GHSA-m2h2-264f-f486"
},
"info": [
"https://github.com/advisories/GHSA-m2h2-264f-f486"
]
},
{
"atOrAbove": "0",
"below": "1.9.8",
Expand Down Expand Up @@ -5283,25 +5332,6 @@ module.exports={
"info": [
"https://docs.angularjs.org/misc/version-support-status"
]
},
{
"atOrAbove": "1.7.0",
"below": "999",
"severity": "medium",
"cwe": [
"CWE-1333",
"CWE-770"
],
"identifiers": {
"summary": "angular vulnerable to regular expression denial of service (ReDoS)",
"CVE": [
"CVE-2022-25844"
],
"githubID": "GHSA-m2h2-264f-f486"
},
"info": [
"https://github.com/advisories/GHSA-m2h2-264f-f486"
]
}
],
"extractors": {
Expand Down Expand Up @@ -10390,7 +10420,7 @@ module.exports={
]
},
{
"atOrAbove": "0",
"atOrAbove": "0.7.30",
"below": "0.7.33",
"cwe": [
"CWE-1333",
Expand Down
6 changes: 6 additions & 0 deletions node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [5.4.0]

### Improvements

- Add possibility to exclude specific versions for a vulnerability (example: jquery-1.12.4-aem which has some extra patches).

## [5.3.0]

### Improvement
Expand Down
5 changes: 4 additions & 1 deletion node/lib/retire.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

var exports = exports || {};
exports.version = '5.3.0';
exports.version = '5.4.0';

function isDefined(o) {
return typeof o !== 'undefined';
Expand Down Expand Up @@ -103,6 +103,9 @@ function check(results, repo) {
if (isDefined(vulns[i].atOrAbove) && !isAtOrAbove(result.version, vulns[i].atOrAbove)) {
continue;
}
if (isDefined(vulns[i].excludes) && vulns[i].excludes.includes(result.version)) {
continue;
}
var vulnerability = { info: vulns[i].info, below: vulns[i].below, atOrAbove: vulns[i].atOrAbove };
if (vulns[i].severity) {
vulnerability.severity = vulns[i].severity;
Expand Down
22 changes: 11 additions & 11 deletions node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Erlend Oftedal <erlend@oftedal.no>",
"name": "retire",
"description": "Retire is a tool for detecting use of vulnerable libraries",
"version": "5.3.0",
"version": "5.4.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
12 changes: 12 additions & 0 deletions node/spec/tests/versions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,16 @@ describe('versions', function () {
assert.isNotVulnerable(result);
done();
});
it('should_not_be_vulnerable_when_version_in_excludes_list', function (done) {
repo.jquery.vulnerabilities = [{ atOrAbove: '1.0.0', below: '3.0.0', excludes: ['1.12.4-aem'] }];
const result = retire.scanUri('https://ajax.googleapis.com/ajax/libs/jquery/1.12.4-aem/jquery.min.js', repo);
assert.isNotVulnerable(result);
done();
});
it('should_be_vulnerable_when_similar_version_not_in_excludes_list', function (done) {
repo.jquery.vulnerabilities = [{ atOrAbove: '1.0.0', below: '3.0.0', excludes: ['1.12.4-aem'] }];
const result = retire.scanUri('https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', repo);
assert.isVulnerable(result);
done();
});
});
2 changes: 1 addition & 1 deletion node/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const jsrepolocation: string[] = (prg.jsrepo ?? "'central'")
.split(',')
.map((x: string) =>
x === "'central'"
? 'https://raw.githubusercontent.com/RetireJS/retire.js/master/repository/jsrepository-v4.json'
? 'https://raw.githubusercontent.com/RetireJS/retire.js/master/repository/jsrepository-v5.json'
: x,
);

Expand Down
1 change: 1 addition & 0 deletions node/src/repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function validateRepository(
.object({
below: versionValidator,
atOrAbove: versionValidator.optional(),
excludes: z.array(versionValidator).optional(),
severity: z.enum(keys),
cwe: z.array(z.string().regex(/^CWE-[0-9]+$/)).min(1),
identifiers: z
Expand Down
1 change: 1 addition & 0 deletions node/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type Repository = Record<
export type Vulnerability = {
below: string;
atOrAbove?: string;
excludes?: string[];
severity: SeverityLevel;
cwe: string[];
identifiers: {
Expand Down
11 changes: 8 additions & 3 deletions repository/convertFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function convertToOldFormat(
input,
includeQueries = false,
includeBackdoored = false,
includeLicenses = false
includeLicenses = false,
includeExcludes = false,
) {
const result = {};
Object.entries(input).forEach(([key, value]) => {
Expand All @@ -28,12 +29,16 @@ function convertToOldFormat(
const { ranges, summary, identifiers, info, ...rest } = v;

ranges.forEach((r) => {
vulns.push({
const vuln = {
...r,
...rest,
identifiers: { summary, ...identifiers },
info,
});
};
if (!includeExcludes && r.excludes) {
vuln.excludes = undefined;
}
vulns.push(vuln);
});
});
vulns.sort((a, b) => {
Expand Down
3 changes: 3 additions & 0 deletions repository/convertToVersioned
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ fs.writeFileSync("jsrepository-v3.json", JSON.stringify(resultV3, null, 2));

const resultV4 = convert(data, true, false, true);
fs.writeFileSync("jsrepository-v4.json", JSON.stringify(resultV4, null, 2));

const resultV5 = convert(data, true, false, true, true);
fs.writeFileSync("jsrepository-v5.json", JSON.stringify(resultV5, null, 2));
6 changes: 4 additions & 2 deletions repository/jsrepository-master.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
},
{
"atOrAbove": "1.12.3",
"below": "3.0.0-beta1"
"below": "3.0.0-beta1",
"excludes": ["1.12.4-aem"]
}
],
"summary": "3rd party CORS request may execute",
Expand Down Expand Up @@ -214,7 +215,8 @@
{
"ranges": [
{
"below": "2.999.999"
"below": "2.999.999",
"excludes": ["1.12.4-aem"]
}
],
"summary": "jQuery 1.x and 2.x are End-of-Life and no longer receiving security updates",
Expand Down
Loading