function orderKeys(obj){var i,keys=Object.keys(obj).sort(function(k1,k2){return k1k2?1:0}),after={};for(i=0;i0?cloneA:null}var cloneO={};for(var i in obj){var c=cloneJSON(obj[i]);null!==c&&""!==c&&(cloneO[i]=c)}return cloneO}function loadimg(e){var sibs=this.parentNode.parentNode.childNodes,f=sibs[1],ok=sibs[4];e.preventDefault();var file=this.files[0];if(file.size>528385)return alert("Image size should less than 500k"),!1;if(-1==file.type.indexOf("image"))return alert("Not an image!"),!1;var reader=new FileReader;return reader.onload=function(event){f.value=event.target.result,ok.click()},reader.readAsDataURL(file),!1}var textUtil={jsonView:function(obj){if(obj instanceof Array){var ret="";for(var k in obj)ret=ret+"";return ret+"
"+this.jsonView(obj)+"
"}if(obj instanceof Object){ret="
";for(var k in obj)obj.hasOwnProperty(k)&&(ret=ret+"
"+k+": "+this.jsonView(obj[k])+"
");return ret+"
"}return obj},reduceJSON:function(cve){var c=cloneJSON(cve);if(delete c.CNA_private,c.description&&c.description.description_data){var d,merged={};for(d of c.description.description_data)d&&d.lang&&(merged[d.lang]||(merged[d.lang]=[]),merged[d.lang].push(d.value));var new_d=[];for(var m in merged)new_d.push({lang:m,value:merged[m].join("\n")});c.description.description_data=new_d}return c.impact&&c.impact.cvss&&0===c.impact.cvss.baseScore&&delete c.impact,orderKeys(c)},getMITREJSON:function(cve){return JSON.stringify(cve,null," ")},getPR:function(cve){for(var m,matches=[],re=/PRs?[ \t]+((or|and|[0-9\t\ \,])+)/gim;null!==(m=re.exec(cve.solution));){var prs=m[1].trim().split(/[ \t,andor]{1,}/).filter(x=>x);matches=matches.concat(prs)}return matches},getAffectedProductString:function(cve){var status={};for(var vendor of cve.affects.vendor.vendor_data){var vendor_name=vendor.vendor_name;for(var product of vendor.product.product_data)for(var version of product.version.version_data){var vv=version.version_value,cat="affected";if(version.version_affected){version.version_affected.startsWith("?")?cat="unknown":version.version_affected.startsWith("!")&&(cat="unaffected");var prefix=product.product_name+" ";switch(version.version_name&&""!=version.version_name&&(prefix+=version.version_name+" "),version.version_affected){case"!":case"?":case"=":vv=version.version_value;break;case"<":case"!<":case"?<":vv=prefix+"versions earlier than "+version.version_value;break;case">":case"?>":vv=prefix+"versions later than "+version.version_value;break;case"<=":case"!<=":case"?<=":vv=product.product_name+" "+version.version_value+" and earlier versions";break;case">=":case"!>=":case"?>=":vv=product.product_name+" "+version.version_value+" and later versions";break;default:vv=version.version_value}}version.platform&&(vv=vv+" on "+version.platform),status[cat]||(status[cat]={}),status[cat][vendor_name+" "+product.product_name]||(status[cat][vendor_name+" "+product.product_name]=[]),status[cat][vendor_name+" "+product.product_name].push(vv)}}var stringifyArray=function(ob){var ret=[];for(var p in ob)ret.push(p+"\n"+ob[p].join(";\n")+".");return ret.join("\n")},ret=[];return status.affected&&ret.push("This issue affects:\n"+stringifyArray(status.affected)),status.unaffected&&ret.push("This issue does not affect:\n"+stringifyArray(status.unaffected)),status.unknown&&ret.push("It is not known whether this issue affects:\n"+stringifyArray(status.unknown)),ret.join("\n\n")},affectedTable:function(cve){var status={};for(var vendor of cve.affects.vendor.vendor_data){var vendor_name=vendor.vendor_name;for(var product of(status[vendor_name]||(status[vendor_name]={}),vendor.product.product_data)){var product_name=product.product_name;for(var version of(status[vendor_name][product_name]||(status[vendor_name][product_name]={}),product.version.version_data)){var vv=version.version_value,cat="affected";vn="";if(version.version_name&&""!=version.version_name&&(vn=version.version_name),version.version_affected)switch(version.version_affected.startsWith("?")?cat="unknown":version.version_affected.startsWith("!")&&(cat="unaffected"),version.version_affected){case"!":case"?":case"=":vv=version.version_value;break;case"<":case"!<":case"?<":vv="< "+version.version_value;break;case">":case"?>":vv="> "+version.version_value;break;case"<=":case"!<=":case"?<=":vv="<= "+version.version_value;break;case">=":case"!>=":case"?>=":vv=">= "+version.version_value;break;default:vv=version.version_value}version.platform&&""!=version.platform&&(vv+=" on "+version.platform),status[vendor_name][product_name][vn]||(status[vendor_name][product_name][vn]={}),status[vendor_name][product_name][vn][cat]||(status[vendor_name][product_name][vn][cat]=[]),status[vendor_name][product_name][vn][cat].push(vv)}}}return status},appliesTo:function(affects){var ret=[];for(var vendor of affects.vendor.vendor_data){vendor.vendor_name;for(var product of vendor.product.product_data){var product_name=product.product_name;for(var version of product.version.version_data){version.version_value,vn="";if(version.version_name&&""!=version.version_name&&(vn=version.version_name),version.version_affected)switch(version.version_affected.startsWith("?")?cat="unknown":version.version_affected.startsWith("!")&&(cat="no"),version.version_affected){case"=":case"<":case">":case"<=":case">=":ret.push(product_name+" "+vn)}}}}return ret},affectedYesNo:function(affects){var status={yes:[],no:[],unknown:[]};for(var vendor of affects.vendor.vendor_data){vendor.vendor_name;for(var product of vendor.product.product_data){var product_name=product.product_name;for(var version of product.version.version_data){var vv=version.version_value,cat="yes";vn="";if(version.version_name&&""!=version.version_name&&(vn=version.version_name),version.version_affected){switch(version.version_affected.startsWith("?")?cat="unknown":version.version_affected.startsWith("!")&&(cat="no"),version.version_affected){case"!":case"?":case"=":vv=version.version_value;break;case"<":case"!<":case"?<":vv="< "+version.version_value;break;case">":case"?>":vv="> "+version.version_value;break;case"<=":case"!<=":case"?<=":vv="<= "+version.version_value;break;case">=":case"!>=":case"?>=":vv=">= "+version.version_value;break;default:vv=version.version_value}version.platform&&""!=version.platform&&(vv+=" on "+version.platform)}var ph=status[cat][product_name];void 0==ph&&(ph=status[cat][product_name]={}),vns=ph.version_names,void 0==vns&&(vns=ph.version_names=[]),vns.indexOf(vn)<0&&vns.push(vn),vvs=ph.version_values,void 0==vvs&&(vvs=ph.version_values=[]),vvs.indexOf(vv)<0&&vvs.push(vv)}}}var rstatus={yes:[],no:[],unknown:[]};for(var cat of["yes","no","unknown"])for(var p in status[cat])rstatus[cat].push({product:p,version_names:status[cat][p].version_names,version_values:status[cat][p].version_values});return rstatus},mergeJSON:function(target,add){function isObject(obj){if("object"==typeof obj)for(var key in obj)if(obj.hasOwnProperty(key))return!0;return!1}for(var key in add)"__proto__"!==key&&"constructor"!==key&&add.hasOwnProperty(key)&&(target[key]&&isObject(target[key])&&isObject(add[key])?this.mergeJSON(target[key],add[key]):target[key]=add[key]);return target},timeSince:function(date){var seconds=Math.floor((new Date-date)/1e3),interval=Math.floor(seconds/31536e3);return interval>1?interval+" years":(interval=Math.floor(seconds/2592e3))>1?interval+" months":(interval=Math.floor(seconds/86400))>1?interval+" days":(interval=Math.floor(seconds/3600))>1?interval+" hours":(interval=Math.floor(seconds/60))>1?interval+" minutes":Math.floor(seconds)+" seconds"},nextPatchDay:function(dateString,weekday){for(var date=new Date(dateString),monthstogo=(12-date.getMonth())%3,count=0,idate=new Date(date.getFullYear(),date.getMonth()+monthstogo,1);idate.getDay()!==weekday||2!=++count;)idate.setDate(idate.getDate()+1);return idate=this.CVSSseveritys[i].bottom&&score<=this.CVSSseveritys[i].top)return this.CVSSseveritys[i];return{name:"?",bottom:"Not",top:"defined"}},roundUp1:function(input){var int_input=Math.round(1e5*input);return int_input%1e4==0?int_input/1e5:(Math.floor(int_input/1e4)+1)/10},calculate:function(cvss){var p,val={},metricWeight={};try{for(p in this.Weight){if(val[p]=cvss[p],void 0===val[p]||""===val[p]||null==val[p])return"?";metricWeight[p]=this.Weight[p][val[p]]}}catch(err){return err}metricWeight.privilegesRequired=this.Weight.privilegesRequired[val.scope][val.privilegesRequired];try{var impactSubScore,exploitability,impactSubScoreMultiplier=1-(1-metricWeight.confidentialityImpact)*(1-metricWeight.integrityImpact)*(1-metricWeight.availabilityImpact);return impactSubScore="UNCHANGED"===val.scope?metricWeight.scope*impactSubScoreMultiplier:metricWeight.scope*(impactSubScoreMultiplier-.029)-3.25*Math.pow(impactSubScoreMultiplier-.02,15),exploitability=8.22*metricWeight.attackVector*metricWeight.attackComplexity*metricWeight.privilegesRequired*metricWeight.userInteraction,(impactSubScore<=0?0:"UNCHANGED"===val.scope?this.roundUp1(Math.min(exploitability+impactSubScore,10)):this.roundUp1(Math.min(1.08*(exploitability+impactSubScore),10))).toFixed(1)}catch(err){return err}},w2:{accessComplexity:{HIGH:.35,MEDIUM:.61,LOW:.71},authentication:{NONE:.704,SINGLE:.56,MULTIPLE:.45},accessVector:{LOCAL:.395,ADJACENT_NETWORK:.646,NETWORK:1},confidentialityImpact:{NONE:0,PARTIAL:.275,COMPLETE:.66},integrityImpact:{NONE:0,PARTIAL:.275,COMPLETE:.66},availabilityImpact:{NONE:0,PARTIAL:.275,COMPLETE:.66}},calculate2:function(cvss){var w2=this.w2,impact=10.41*(1-(1-w2.confidentialityImpact[cvss.confidentialityImpact])*(1-w2.integrityImpact[cvss.integrityImpact])*(1-w2.availabilityImpact[cvss.availabilityImpact]));return 0==impact?0:(1.176*(.6*impact+.4*(20*w2.accessComplexity[cvss.accessComplexity]*w2.authentication[cvss.authentication]*w2.accessVector[cvss.accessVector])-1.5)).toFixed(1)}};