Skip to content

Commit

Permalink
πŸ”Š add note on unexpected CVE repro
Browse files Browse the repository at this point in the history
  • Loading branch information
ctcpip committed Feb 19, 2024
1 parent 6a7b621 commit 3f354e8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions security/site/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,11 @@ function updateCVE(cve) {
const cveID = `CVE-${cve[0]}`;
const version = sessionStorage.getItem(VERSION); // use version from session/select because our CVE map doesn't have the patched versions
const patched = sessionStorage.getItem(PATCHED) === 'true';
const isAffectedVersion = cve[1].versions.includes(version);

const $relevantCVEFooter = $(`div.cve__header:contains(${cveID})`).siblings('.cve__footer');
const $footerStatus = $('.cve__footer-status', $relevantCVEFooter);
const $footerNote = $('.cve__footer-note', $relevantCVEFooter);

const { triggered } = cve[1];
let { triggerCount } = cve[1];
Expand All @@ -179,15 +181,17 @@ function updateCVE(cve) {
triggerCount = Number.isInteger(triggerCount) ? triggerCount += 1 : 1;
$footerStatus.text(`CVE triggered ${triggerCount} time${triggerCount > 1 ? 's' : ''}`);
cve[1].triggerCount = triggerCount;

if(!isAffectedVersion) {
$footerNote.text(`but v${version} shouldn't be vulnerable πŸ€”`);
}

}
else {
$footerStatus.text(`Can't reproduce! πŸŽ‰`);

if(!patched) {

const $footerNote = $('.cve__footer-note', $relevantCVEFooter);

if(cve[1].versions.includes(version)) {
if(isAffectedVersion) {
$footerNote.text(`but v${version} should be vulnerable πŸ€”`);
}
else {
Expand Down

0 comments on commit 3f354e8

Please sign in to comment.