diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 96278e9..e69de29 --- a/README.md +++ b/README.md @@ -1,14 +0,0 @@ -## :rocket: 背景 - -近年来,开源软件供应链遭受持续的软件投毒和恶意代码攻击,造成了无法估计的损失。例如,Apache Log4j2远程代码执行漏洞被认为是近10年最严重的漏洞之一,攻击者可以在目标服务器上执行任意代码和嗅探系统信息。网络安全专家认为Log4j 中的远程代码执行漏洞可能需要数月甚至数年时间才能得到妥善解决。受Log4J漏洞影响组件包括Apache的Struts2、Solr、Druid、Flink等,Github上60,644个开源项目发布321,094软件存在风险。因此,当前急需智能化技术辅助降低漏洞风险,提高漏洞工程能力,减少漏洞损失。 - - -## :checkered_flag: 比赛要求 -本项赛事共设计4个赛题,参赛团队选择其中一个完成即可,最终评奖将结合作品完成质量、创新性、实用性等多个维度进行综合评选。 - -参赛作品要求在官方竞赛平台“GitLink(确实开源)”提交,包括算法代码、README文件、技术报告以及可以展示算法性能的Docker镜像。具体要求参见赛事网站的“参赛指南”。 - -注:推荐使用开源大模型。 - - - diff --git a/README_V2.md b/README_V2.md new file mode 100755 index 0000000..a67798a --- /dev/null +++ b/README_V2.md @@ -0,0 +1,85 @@ +# 基于大规模语言模型的软件漏洞检测 + +本项目利用大规模语言模型 (LLMs) 进行软件漏洞检测,特别关注于识别引入漏洞的代码提交。 + +## 文件结构 + +``` +. +├── data +│ └── dataset.json +├── src +│ ├── __init__.py +│ ├── config.py +│ ├── data_loader.py +│ ├── evaluator.py +│ ├── model.py +│ ├── preprocessor.py +│ ├── trainer.py +│ └── utils.py +├── tests +│ ├── __init__.py +│ ├── test_data_loader.py +│ ├── test_model.py +│ └── test_preprocessor.py +├── output +│ └── results.json +├── main.py +├── requirements.txt +├── Dockerfile +└── README.md +``` + +## 环境配置 + +本项目使用 Docker 来确保环境的一致性和可复现性。请按照以下步骤配置环境: + +1. **安装 Docker 和 NVIDIA Container Toolkit**(如果使用 GPU)。 + + +2. **构建 Docker 镜像**: + + ``` + docker build -t vulnerability-detection . + ``` + +3. **运行 Docker 容器**: + + ``` + docker run --gpus all -it --rm -p 8888:8888 -v $(pwd):/app vulnerability-detection + ``` + + 这个命令会启动一个 Jupyter Lab 实例,并将当前目录挂载到容器的 `/app` 目录中。 + + 在浏览器中打开 Jupyter Lab(URL 会在控制台输出)。 + +## 运行代码 + +为了复现报告中的结果,请按照以下步骤操作: + +1. **准备数据**: + + 确保您已经获得了完整的数据集(`dataset.json`),并将其放置在 `data/` 目录下。由于数据集可能包含敏感信息,我们没有在公开仓库中包含它。 + +2. **在 Jupyter Lab 中打开 `main.py` 文件**。 + +3. **运行 `main.py` 文件**: + + 这个过程可能需要几个小时,具体取决于您的硬件配置和数据集大小。 + +4. **查看结果**: + + 运行完成后,结果将保存在 `output/results.json` 文件中。 + + 您可以使用以下代码查看结果: + + ``` + import json + + with open('output/results.json', 'r') as f: + results = json.load(f) + + print(f"Precision: {results['precision']:.4f}") + print(f"Recall: {results['recall']:.4f}") + print(f"F1 Score: {results['f1_score']:.4f}") + ``` \ No newline at end of file diff --git a/Report.pdf b/Report.pdf new file mode 100644 index 0000000..f032d50 Binary files /dev/null and b/Report.pdf differ diff --git a/data/dataset.json b/data/dataset.json new file mode 100755 index 0000000..bb79756 --- /dev/null +++ b/data/dataset.json @@ -0,0 +1,3336 @@ +{ + "activemq": { + "CVE-2012-6092": { + "cwe": "CWE-79", + "fixing_commits": { + "51eb87a84be88d28383ea48f6e341ffe1203c5ba": { + "activemq-web-demo/src/main/webapp/websocket/chat.js": { + "32": { + "Vulnerability Introducing Commit": [ + "e72f43f8e6f23a29112a6e85dc44d707eeb4e547" + ] + }, + "42": { + "Vulnerability Introducing Commit": [ + "e72f43f8e6f23a29112a6e85dc44d707eeb4e547" + ] + } + }, + "activemq-web/src/main/java/org/apache/activemq/web/PortfolioPublishServlet.java": { + "73": { + "Vulnerability Introducing Commit": [ + "40a7d3b6ac35d2ecb34e85fc3403d2e48e33874e" + ] + } + } + } + } + }, + "CVE-2013-1880": { + "cwe": "CWE-79", + "fixing_commits": { + "fafd12dfd4f71336f8e32c090d40ed1445959b40": { + "activemq-web/src/main/java/org/apache/activemq/web/PortfolioPublishServlet.java": { + "71": { + "Vulnerability Introducing Commit": [ + "40a7d3b6ac35d2ecb34e85fc3403d2e48e33874e" + ] + } + }, + "assembly/src/sample-conf/activemq-demo.xml": { + "204": { + "Vulnerability Introducing Commit": [] + }, + "205": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2014-3576": { + "cwe": "CWE-264", + "fixing_commits": { + "00921f22ff9a8792d7663ef8fadd4823402a6324": { + "activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java": { + "1537": { + "Vulnerability Introducing Commit": [ + "98cd515fff69a930164df0a4f03e69f720362522" + ] + }, + "1538": { + "Vulnerability Introducing Commit": [ + "fb3b6dba571b9dbffaac45ac920037760ceb6dbc" + ] + }, + "1539": { + "Vulnerability Introducing Commit": [ + "fb3b6dba571b9dbffaac45ac920037760ceb6dbc" + ] + }, + "1540": { + "Vulnerability Introducing Commit": [ + "ecf89a60bfd8089d1b1de5666bd2e9d5938abe8e" + ] + } + } + } + } + }, + "CVE-2015-1830": { + "cwe": "CWE-22", + "fixing_commits": { + "729c4731574ffffaf58ebefdbaeb3bd19ed1c7b7": { + "activemq-fileserver/src/main/java/org/apache/activemq/util/FilenameGuardFilter.java": { + "63": { + "Vulnerability Introducing Commit": [ + "e6d20f3932b556377218ac2e353a2cc99d26d1ea" + ] + } + } + }, + "9fd5cb7dfe0fcc431f99d5e14206e0090e72f36b": { + "activemq-fileserver/src/main/java/org/apache/activemq/util/FilenameGuardFilter.java": { + "63": { + "Vulnerability Introducing Commit": [ + "e6d20f3932b556377218ac2e353a2cc99d26d1ea" + ] + } + }, + "activemq-fileserver/src/main/webapp/index.html": { + "19": { + "Vulnerability Introducing Commit": [] + }, + "26": { + "Vulnerability Introducing Commit": [] + } + } + } + } + } + }, + "blynk-server": { + "CVE-2018-17785": { + "cwe": "CWE-22", + "fixing_commits": { + "806bc7847a687203a904d24feb1a0278de889e62": { + "server/http-core/src/main/java/cc/blynk/core/http/handlers/StaticFileHandler.java": { + "189": { + "Vulnerability Introducing Commit": [ + "c148408df43fa2e3c7f4ad1446c3abc8f0ecc2cc" + ] + } + } + } + } + } + }, + "brooklyn-server": { + "CVE-2016-8744": { + "cwe": "CWE-502", + "fixing_commits": { + "3ae4a4d156341a53e54a2fe07192f46b15763d06": { + "utils/common/src/main/java/org/apache/brooklyn/util/yaml/Yamls.java": { + "96": { + "Vulnerability Introducing Commit": [] + }, + "155": { + "Vulnerability Introducing Commit": [] + }, + "162": { + "Vulnerability Introducing Commit": [] + }, + "539": { + "Vulnerability Introducing Commit": [] + } + } + } + } + } + }, + "buck": { + "CVE-2018-6331": { + "cwe": "CWE-502", + "fixing_commits": { + "8c5500981812564877bd122c0f8fab48d3528ddf": { + "src/com/facebook/buck/cli/ParserCacheCommand.java": { + "91": { + "Vulnerability Introducing Commit": [ + "e6d6dfacb93311425f4c1336a1107c657e647bb9" + ] + } + } + } + } + } + }, + "cayenne": { + "CVE-2018-11758": { + "cwe": "CWE-611", + "fixing_commits": { + "6fc896b65ed871be33dcf453cde924bf73cf83db": { + "cayenne-server/src/main/java/org/apache/cayenne/util/Util.java": { + "354": { + "Vulnerability Introducing Commit": [ + "fc186f50392bf8c804b1d314971c92efa5f52fc3" + ] + }, + "357": { + "Vulnerability Introducing Commit": [ + "fc186f50392bf8c804b1d314971c92efa5f52fc3" + ] + }, + "359": { + "Vulnerability Introducing Commit": [ + "fc186f50392bf8c804b1d314971c92efa5f52fc3" + ] + } + } + } + } + } + }, + "ccm-plugin": { + "CVE-2018-1000054": { + "cwe": "CWE-918", + "fixing_commits": { + "066cb43b4413b3490d822ec8b8a32072ebd213ca": { + "pom.xml": { + "73": { + "Vulnerability Introducing Commit": [] + } + }, + "src/main/java/hudson/plugins/ccm/parser/CcmParser.java": { + "87": { + "Vulnerability Introducing Commit": [ + "0bdbebe1b3d73341bf67051986aec66944aee928" + ] + }, + "88": { + "Vulnerability Introducing Commit": [ + "0bdbebe1b3d73341bf67051986aec66944aee928" + ] + }, + "89": { + "Vulnerability Introducing Commit": [ + "0bdbebe1b3d73341bf67051986aec66944aee928" + ] + } + } + } + } + } + }, + "commons-compress": { + "CVE-2018-11771": { + "cwe": "CWE-835", + "fixing_commits": { + "a41ce6892cb0590b2e658704434ac0dbcb6834c8": { + "src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java": { + "528": { + "Vulnerability Introducing Commit": [ + "008ca948dadacea8d1a2662c577fdcb25f32d5e2" + ] + } + } + } + } + }, + "CVE-2018-1324": { + "cwe": "CWE-835", + "fixing_commits": { + "2a2f1dc48e22a34ddb72321a4db211da91aa933b": { + "src/main/java/org/apache/commons/compress/archivers/zip/X0017_StrongEncryptionHeader.java": { + "313": { + "Vulnerability Introducing Commit": [ + "a433f625f89c1d464b05186411ff20802e292fb4" + ] + } + } + } + } + } + }, + "commons-fileupload": { + "CVE-2014-0050": { + "cwe": "CWE-264", + "fixing_commits": { + "c61ff05b3241cb14d989b67209e57aa71540417a": { + "src/main/java/org/apache/commons/fileupload/FileUploadBase.java": { + "994": { + "Vulnerability Introducing Commit": [ + "684984971e95ac0dff142934323d02df77168126" + ] + } + }, + "src/main/java/org/apache/commons/fileupload/MultipartStream.java": { + "334": { + "Vulnerability Introducing Commit": [ + "d423dbce722380807f3c6cc26e5c3758937b0234" + ] + } + }, + "src/test/java/org/apache/commons/fileupload/MultipartStreamTest.java": { + "41": { + "Vulnerability Introducing Commit": [] + } + } + } + } + } + }, + "cordova-plugin-file-transfer": { + "CVE-2015-5204": { + "cwe": "NVD-CWE-Other", + "fixing_commits": { + "2b31723708256c08c5209308eb6ccfb03e2ab990": { + "src/android/FileTransfer.java": { + "222": { + "Vulnerability Introducing Commit": [ + "ad6647120db12f0e67ee4a952a71ea494a39a475" + ] + } + } + }, + "ad6647120db12f0e67ee4a952a71ea494a39a475": { + "src/android/FileTransfer.java": { + "204": { + "Vulnerability Introducing Commit": [ + "35e89b3aeccc9377d85ea382091ea50a0915949f" + ] + } + } + } + } + } + }, + "cxf": { + "CVE-2013-0239": { + "cwe": "CWE-287", + "fixing_commits": { + "295a4e2f9eb3e7e0513980202949ccc424dee2d4": { + "rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyvalidators/UsernameTokenPolicyValidator.java": { + "97": { + "Vulnerability Introducing Commit": [ + "956ea048b6390f57f2ea68d78139e7c61404c4e1" + ] + } + }, + "systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java": { + "74": { + "Vulnerability Introducing Commit": [] + }, + "112": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2015-5253": { + "cwe": "CWE-264", + "fixing_commits": { + "845eccb6484b43ba02875c71e824db23ae4f20c0": { + "rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLSSOResponseValidator.java": { + "95": { + "Vulnerability Introducing Commit": [ + "f3a4019a87dc58084b38057e0fa4c9577a0cb57e" + ] + }, + "117": { + "Vulnerability Introducing Commit": [ + "f3a4019a87dc58084b38057e0fa4c9577a0cb57e" + ] + }, + "129": { + "Vulnerability Introducing Commit": [ + "f3a4019a87dc58084b38057e0fa4c9577a0cb57e" + ] + }, + "143": { + "Vulnerability Introducing Commit": [ + "4224f1ff1c70027c9df680985d188b1857a0bad5" + ] + } + } + } + } + }, + "CVE-2016-8739": { + "cwe": "CWE-611", + "fixing_commits": { + "8e4970d931ae72f92c54d170a844b37137b8fda6": { + "rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AbstractAtomProvider.java": { + "92": { + "Vulnerability Introducing Commit": [ + "8ae768d769543c82c834ee9f9df883c9b5bbe56b" + ] + }, + "95": { + "Vulnerability Introducing Commit": [ + "42d3104c050e94c82e1659c0226646b66a42e14c" + ] + } + } + }, + "9deb2d179758d3da47ce3ea492c2606c0a6a8475": { + "rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AbstractAtomProvider.java": { + "92": { + "Vulnerability Introducing Commit": [ + "37b616d3e542f4b8adb131171a4fad337278be5c" + ] + }, + "95": { + "Vulnerability Introducing Commit": [ + "42d3104c050e94c82e1659c0226646b66a42e14c" + ] + } + } + }, + "d9e2a6e7260ea12efa5355ffdfbf0b2415bccd14": { + "rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/atom/AbstractAtomProvider.java": { + "92": { + "Vulnerability Introducing Commit": [ + "267622c645564bfa5ae82dc6b11d83b8797e119f" + ] + }, + "95": { + "Vulnerability Introducing Commit": [ + "42d3104c050e94c82e1659c0226646b66a42e14c" + ] + } + } + } + } + }, + "CVE-2017-3156": { + "cwe": "NVD-CWE-noinfo", + "fixing_commits": { + "1338469f7d25cfcda75b547c68bed95bd97903ac": { + "rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesCbcHmacJweDecryption.java": { + "59": { + "Vulnerability Introducing Commit": [ + "3dc932f502e3486d7de5825d097b4d7000d8ecbe" + ] + } + }, + "rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jws/HmacJwsSignatureVerifier.java": { + "56": { + "Vulnerability Introducing Commit": [ + "8adaa1d2bbe2f5a55e40ebf9189e9040f82cac0d" + ] + } + }, + "rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/tokens/hawk/AbstractHawkAccessTokenValidator.java": { + "81": { + "Vulnerability Introducing Commit": [ + "e9b59cae176724350aee787de86c531242b51023" + ] + } + } + }, + "555843f9563ccfc2ca1afb2950aebb4505d7711b": { + "rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesCbcHmacJweDecryption.java": { + "59": { + "Vulnerability Introducing Commit": [] + } + } + }, + "e66ce235ee5f8dbde467c8c23eeb622b072d0bf3": { + "rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/AesCbcHmacJweDecryption.java": { + "59": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2018-8039": { + "cwe": "CWE-755", + "fixing_commits": { + "8ed6208f987ff72e4c4d2cf8a6b1ec9b27575d4b": { + "rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java": { + "196": { + "Vulnerability Introducing Commit": [ + "b933e1921ab80c22a4faf8cb412bb46aa523f9b8" + ] + } + } + }, + "fae6fabf9bd7647f5e9cb68897a7d72b545b741b": { + "rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java": { + "185": { + "Vulnerability Introducing Commit": [ + "1120e6ff3f3f419e07f6410a27b56ae56ea53550" + ] + } + } + } + } + } + }, + "cxf-fediz": { + "CVE-2016-4464": { + "cwe": "CWE-284", + "fixing_commits": { + "0006581e9cacbeef46381a223e5671e524d416b6": { + "plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FedizContext.java": { + "88": { + "Vulnerability Introducing Commit": [ + "d1a9c55cfd07735b882b1820e5b0ab45595a4059" + ] + } + }, + "plugins/core/src/main/java/org/apache/cxf/fediz/core/handler/SigninHandler.java": { + "75": { + "Vulnerability Introducing Commit": [ + "2b008eacd31e1720794089226a12107a57efb969" + ] + } + } + } + } + } + }, + "FFmpeg": { + "CVE-2012-5150": { + "cwe": "CWE-399", + "fixing_commits": { + "ae3d41636942cbc0236bad21ad06c65f4eb0f096": { + "libavformat/matroskadec.c": { + "2234": { + "Vulnerability Introducing Commit": [ + "7521c4bab28ff3a622171be5b39a6b210f4263f0" + ] + } + } + } + } + }, + "CVE-2013-0864": { + "cwe": "CWE-189", + "fixing_commits": { + "c10350358da58600884292c08a8690289b81de29": { + "libavcodec/gifdec.c": { + "122": { + "Vulnerability Introducing Commit": [ + "91499f4ee825502677dfc11b00205538720d0513" + ] + } + } + } + } + }, + "CVE-2013-2276": { + "cwe": "NVD-CWE-Other", + "fixing_commits": { + "8a6449167a6da8cb747cfe3502ae86ffaac2ed48": { + "libavcodec/utils.c": { + "1834": { + "Vulnerability Introducing Commit": [ + "2fe186409bf3249669271502298bdc8844ce4e0b" + ] + } + } + } + } + }, + "CVE-2013-3671": { + "cwe": "CWE-189", + "fixing_commits": { + "7edb984dd051b6919d7d8471c70499273f31b0fa": { + "libavutil/log.c": { + "183": { + "Vulnerability Introducing Commit": [ + "e69263cd01380b7b20b92588dcac324bf776b59f" + ] + } + } + } + } + }, + "CVE-2013-4264": { + "cwe": "CWE-119", + "fixing_commits": { + "2960576378d17d71cc8dccc926352ce568b5eec1": { + "libavcodec/g2meet.c": { + "392": { + "Vulnerability Introducing Commit": [ + "2d66a58ccde05e764594bd7e5f0f9244634d0b2c" + ] + } + } + } + } + }, + "CVE-2013-7014": { + "cwe": "CWE-189", + "fixing_commits": { + "86736f59d6a527d8bc807d09b93f971c0fe0bb07": { + "libavcodec/pngdsp.c": { + "34": { + "Vulnerability Introducing Commit": [ + "e92003514d7aab25d56e2d827820f47755d397ec" + ] + } + } + } + } + }, + "CVE-2014-8546": { + "cwe": "CWE-189", + "fixing_commits": { + "e7e5114c506957f40aafd794e06de1a7e341e9d5": { + "libavcodec/cinepak.c": { + "138": { + "Vulnerability Introducing Commit": [ + "2fdf638b0c66c22357d56f7cb205dd241b4a8c58" + ] + } + } + } + } + }, + "CVE-2015-6761": { + "cwe": "CWE-362", + "fixing_commits": { + "dabea74d0e82ea80cd344f630497cafcb3ef872c": { + "libavcodec/vp8.c": { + "167": { + "Vulnerability Introducing Commit": [ + "951455c1c18d54177f281dba174078e54a835361" + ] + } + } + } + } + }, + "CVE-2015-8364": { + "cwe": "CWE-189", + "fixing_commits": { + "df91aa034b82b77a3c4e01791f4a2b2ff6c82066": { + "libavcodec/ivi.c": { + "313": { + "Vulnerability Introducing Commit": [ + "28dda8a691f1c723a4a9365ab85f9625f1330096" + ] + } + } + } + } + }, + "CVE-2016-10192": { + "cwe": "CWE-119", + "fixing_commits": { + "a5d25faa3f4b18dac737fdb35d0dd68eb0dc2156": { + "ffserver.c": { + "2741": { + "Vulnerability Introducing Commit": [ + "19c8c4ecf4e26762327a472dcf34132ceb196e30" + ] + } + } + } + } + }, + "CVE-2016-5199": { + "cwe": "CWE-119", + "fixing_commits": { + "347cb14b7cba7560e53f4434b419b9d8800253e7": { + "libavformat/mov.c": { + "3281": { + "Vulnerability Introducing Commit": [ + "9ea812692c38c58a343cec5f66e8949655906edc" + ] + } + } + } + } + }, + "CVE-2017-14059": { + "cwe": "CWE-834", + "fixing_commits": { + "7e80b63ecd259d69d383623e75b318bf2bd491f6": { + "libavformat/cinedec.c": { + "270": { + "Vulnerability Introducing Commit": [ + "40f88796c69ae453e5fc4b8cd6432fa0ca85b923" + ] + } + } + } + } + }, + "CVE-2017-14169": { + "cwe": "CWE-20", + "fixing_commits": { + "9d00fb9d70ee8c0cc7002b89318c5be00f1bbdad": { + "libavformat/mxfdec.c": { + "503": { + "Vulnerability Introducing Commit": [ + "daa290580dade36a69544a191e6983e920885c16" + ] + } + } + } + } + }, + "CVE-2017-14767": { + "cwe": "CWE-119", + "fixing_commits": { + "c42a1388a6d1bfd8001bf6a4241d8ca27e49326d": { + "libavformat/rtpdec_h264.c": { + "169": { + "Vulnerability Introducing Commit": [ + "1c7e2cf9d33968375ee4025d2279c937e147dae2" + ] + } + } + } + } + }, + "CVE-2017-5024": { + "cwe": "CWE-119", + "fixing_commits": { + "2d453188c2303da641dafb048dc1806790526dfd": { + "libavformat/mov.c": { + "4792": { + "Vulnerability Introducing Commit": [ + "70b922f371e27440a51ee1e9cc1c7db0e042ebd1" + ] + } + } + } + } + }, + "CVE-2017-7862": { + "cwe": "CWE-787", + "fixing_commits": { + "8c2ea3030af7b40a3c4275696fb5c76cdb80950a": { + "libavcodec/pictordec.c": { + "145": { + "Vulnerability Introducing Commit": [ + "a526d6197a539852bcdcf737b2faaa9123e992de" + ] + } + } + } + } + }, + "CVE-2017-9992": { + "cwe": "CWE-119", + "fixing_commits": { + "f52fbf4f3ed02a7d872d8a102006f29b4421f360": { + "libavcodec/dfa.c": { + "178": { + "Vulnerability Introducing Commit": [ + "8099187e897ddc90cb3902332c76fb2542dac308" + ] + } + } + } + } + }, + "CVE-2017-9996": { + "cwe": "CWE-119", + "fixing_commits": { + "e1b60aad77c27ed5d4dfc11e5e6a05a38c70489d": { + "libavcodec/cdxl.c": { + "280": { + "Vulnerability Introducing Commit": [ + "dc4e57489fa0f9cf4faf4c85cc405d6db77d84db" + ] + } + } + } + } + }, + "CVE-2018-6621": { + "cwe": "CWE-125", + "fixing_commits": { + "118e1b0b3370dd1c0da442901b486689efd1654b": { + "libavcodec/utvideodec.c": { + "679": { + "Vulnerability Introducing Commit": [ + "3ecc59bc35412d0cc2299668dd1f79fff090eb3f" + ] + } + } + } + } + }, + "CVE-2018-7751": { + "cwe": "CWE-835", + "fixing_commits": { + "a6cba062051f345e8ebfdff34aba071ed73d923f": { + "libavformat/img2dec.c": { + "884": { + "Vulnerability Introducing Commit": [ + "a20f64bee235042f6e35c8e7ae65ccfddbf7343b" + ] + } + } + } + } + } + }, + "geronimo": { + "CVE-2013-1777": { + "cwe": "CWE-94", + "fixing_commits": { + "ee031c5e62b0d358250d06c2aa6722518579a6c5": { + "framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting/JMXConnector.java": { + "195": { + "Vulnerability Introducing Commit": [] + }, + "209": { + "Vulnerability Introducing Commit": [ + "b60bf0a205e0257cb3279b08fb6c8d48bc7ce67a" + ] + } + }, + "framework/modules/geronimo-jmx-remoting/src/main/java/org/apache/geronimo/jmxremoting/JMXSecureConnector.java": { + "142": { + "Vulnerability Introducing Commit": [] + }, + "160": { + "Vulnerability Introducing Commit": [ + "b60bf0a205e0257cb3279b08fb6c8d48bc7ce67a" + ] + } + } + } + } + } + }, + "google-play-android-publisher-plugin": { + "CVE-2018-1000109": { + "cwe": "CWE-863", + "fixing_commits": { + "f81b058289caf3332ae40d599a36a3665b1fa13c": { + "src/main/java/org/jenkinsci/plugins/googleplayandroidpublisher/GooglePlayBuildStepDescriptor.java": { + "31": { + "Vulnerability Introducing Commit": [ + "ca45adbe672224e24bef9cc216e9fbf04a6d118d" + ] + }, + "32": { + "Vulnerability Introducing Commit": [ + "ca45adbe672224e24bef9cc216e9fbf04a6d118d" + ] + }, + "39": { + "Vulnerability Introducing Commit": [ + "ca45adbe672224e24bef9cc216e9fbf04a6d118d" + ] + }, + "41": { + "Vulnerability Introducing Commit": [ + "ca45adbe672224e24bef9cc216e9fbf04a6d118d" + ] + } + } + } + } + } + }, + "guava": { + "CVE-2018-10237": { + "cwe": "CWE-502", + "fixing_commits": { + "f89ece5721b2f637fe754937ff1f3c86d80bb196": { + "android/guava/src/com/google/common/util/concurrent/AtomicDoubleArray.java": { + "252": { + "Vulnerability Introducing Commit": [ + "9b94fb3965c6869b0ac47420958a4bbae0b2d54c" + ] + }, + "256": { + "Vulnerability Introducing Commit": [ + "9b94fb3965c6869b0ac47420958a4bbae0b2d54c" + ] + } + }, + "guava-gwt/src/com/google/common/collect/CompoundOrdering_CustomFieldSerializer.java": { + "39": { + "Vulnerability Introducing Commit": [ + "8f203c48cbbfe47569d8101a12a8fc9384e09674" + ] + } + }, + "guava/src/com/google/common/util/concurrent/AtomicDoubleArray.java": { + "252": { + "Vulnerability Introducing Commit": [ + "9b1de11918c7e17b02c883365b1d13532988ee05" + ] + }, + "256": { + "Vulnerability Introducing Commit": [ + "9b1de11918c7e17b02c883365b1d13532988ee05" + ] + } + } + } + } + } + }, + "ImageMagick": { + "CVE-2016-10049": { + "cwe": "CWE-119", + "fixing_commits": { + "13db820f5e24cd993ee554e99377fea02a904e18": { + "coders/rle.c": { + "319": { + "Vulnerability Introducing Commit": [ + "7131d8ff451a1d5163e7e35b7a910df80cb54fab" + ] + }, + "322": { + "Vulnerability Introducing Commit": [ + "2174484dfa68a594e2f9ad17f46217b6120db18d" + ] + } + } + } + } + }, + "CVE-2016-5688": { + "cwe": "CWE-119", + "fixing_commits": { + "aecd0ada163a4d6c769cec178955d5f3e9316f2f": { + "MagickCore/image.c": { + "846": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + } + } + } + } + }, + "CVE-2016-6823": { + "cwe": "CWE-190", + "fixing_commits": { + "4cc6ec8a4197d4c008577127736bf7985d632323": { + "coders/bmp.c": { + "1688": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + } + } + } + } + }, + "CVE-2016-7799": { + "cwe": "CWE-125", + "fixing_commits": { + "a7bb158b7bedd1449a34432feb3a67c8f1873bfa": { + "MagickCore/profile.c": { + "2035": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + } + } + } + } + }, + "CVE-2016-7906": { + "cwe": "CWE-416", + "fixing_commits": { + "90406972f108c4da71f998601b06abdc2ac6f06e": { + "MagickCore/attribute.c": { + "1267": { + "Vulnerability Introducing Commit": [ + "940942b0a7bccda8a96c21c8c5b1d37268173038" + ] + } + } + } + } + }, + "CVE-2016-8862": { + "cwe": "CWE-119", + "fixing_commits": { + "aea6c6507f55632829e6432f8177a084a57c9fcc": { + "coders/rle.c": { + "227": { + "Vulnerability Introducing Commit": [ + "caf07b0f71a915d00c6667efd90a138340735eb7" + ] + } + } + } + } + }, + "CVE-2016-8866": { + "cwe": "CWE-119", + "fixing_commits": { + "ab2c9d6a8dd6d71b161ec9cc57a588b116b52322": { + "coders/rle.c": { + "227": { + "Vulnerability Introducing Commit": [ + "caf07b0f71a915d00c6667efd90a138340735eb7" + ] + } + } + } + } + }, + "CVE-2017-11188": { + "cwe": "CWE-834", + "fixing_commits": { + "e9728345edd0141b4724e54832103055a94708b8": { + "coders/dpx.c": { + "1120": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + }, + "1145": { + "Vulnerability Introducing Commit": [ + "04ea8a0176bc11af2fda9f0369a6708919652d5e" + ] + } + } + } + } + }, + "CVE-2017-11478": { + "cwe": "CWE-835", + "fixing_commits": { + "e727ff8c84eafdb012f73d6fe29db11650f73f1a": { + "coders/djvu.c": { + "878": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + } + } + } + } + }, + "CVE-2017-11505": { + "cwe": "CWE-834", + "fixing_commits": { + "45e53a7ad94ce3573d9997704bf32e1f3097f9c0": { + "coders/png.c": { + "4387": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + }, + "5250": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + } + } + } + } + }, + "CVE-2017-11528": { + "cwe": "CWE-772", + "fixing_commits": { + "7ede0be7c379b2a105cae9d9633727845d5458cc": { + "coders/dib.c": { + "622": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + } + } + } + } + }, + "CVE-2017-11536": { + "cwe": "CWE-772", + "fixing_commits": { + "167e1538ae9818d46c9462a4273082871e35a480": { + "coders/jp2.c": { + "920": { + "Vulnerability Introducing Commit": [ + "7ea349614d7582d3c7e54afc52360d8db73a8f67" + ] + } + } + } + } + }, + "CVE-2017-12433": { + "cwe": "CWE-772", + "fixing_commits": { + "7beec9a7a8a5701652b313e6e94bafd36b3627dc": { + "coders/pes.c": { + "627": { + "Vulnerability Introducing Commit": [ + "787ee25e9fb0e4e0509121342371d925fe5044f8" + ] + } + } + } + } + }, + "CVE-2017-12666": { + "cwe": "CWE-772", + "fixing_commits": { + "d5559407ce29f4371e5df9c1cbde65455fe5854c": { + "coders/inline.c": { + "319": { + "Vulnerability Introducing Commit": [ + "642e14ef198b90419df5bf71ad396c19b6e85809" + ] + } + } + } + } + }, + "CVE-2017-12667": { + "cwe": "CWE-772", + "fixing_commits": { + "bfb7915d4b2e11acb6a819e451c382dc645277db": { + "coders/mat.c": { + "934": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + } + } + } + } + }, + "CVE-2017-14324": { + "cwe": "CWE-772", + "fixing_commits": { + "399631650b38eaf21c2f3c306b8b74e66be6a0d2": { + "coders/mpc.c": { + "572": { + "Vulnerability Introducing Commit": [ + "7fd419441bc7103398e313558171d342c6315f44" + ] + }, + "573": { + "Vulnerability Introducing Commit": [ + "7fd419441bc7103398e313558171d342c6315f44" + ] + } + } + } + } + }, + "CVE-2017-14739": { + "cwe": "CWE-476", + "fixing_commits": { + "6017a80fe8327fefb77fa677d81154db2b857d1d": { + "MagickCore/resample-private.h": { + "58": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + }, + "64": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + } + } + } + } + }, + "CVE-2017-15033": { + "cwe": "CWE-772", + "fixing_commits": { + "ef8f40689ac452398026c07da41656a7c87e4683": { + "coders/yuv.c": { + "214": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + }, + "445": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + } + } + } + } + }, + "CVE-2017-17883": { + "cwe": "CWE-772", + "fixing_commits": { + "b0a7241df0f889cc3158ba82774ff21fa1da87ec": { + "coders/pgx.c": { + "219": { + "Vulnerability Introducing Commit": [ + "68ea6a0257d72112016180a057ea0778460c05d4" + ] + }, + "220": { + "Vulnerability Introducing Commit": [ + "68ea6a0257d72112016180a057ea0778460c05d4" + ] + } + } + } + } + }, + "CVE-2018-8804": { + "cwe": "CWE-415", + "fixing_commits": { + "f55d3a622d234e940fb99325b92c6d3df578fa9b": { + "coders/ept.c": { + "419": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + }, + "421": { + "Vulnerability Introducing Commit": [ + "3ed852eea50f9d4cd633efb8c2b054b8e33c2530" + ] + } + } + } + } + } + }, + "javamelody": { + "CVE-2013-4378": { + "cwe": "CWE-79", + "fixing_commits": { + "aacbc46151ff4ac1ca34ce0899c2a6113071c66e": { + "javamelody-core/src/main/java/net/bull/javamelody/HtmlSessionInformationsReport.java": { + "162": { + "Vulnerability Introducing Commit": [ + "2a260d96e9e905e7e574b8d92af8e2abd8ee4cc6" + ] + } + } + } + } + } + }, + "jenkins": { + "CVE-2013-7330": { + "cwe": "CWE-264", + "fixing_commits": { + "36342d71e29e0620f803a7470ce96c61761648d8": { + "core/src/main/java/hudson/model/Descriptor.java": { + "939": { + "Vulnerability Introducing Commit": [ + "e1154a85a146a0b4757a5d5b29d62c8c04d39b6e" + ] + }, + "949": { + "Vulnerability Introducing Commit": [ + "e1154a85a146a0b4757a5d5b29d62c8c04d39b6e" + ] + }, + "963": { + "Vulnerability Introducing Commit": [ + "8d771bc2e335fea5369ba06066c87866494fa5e3" + ] + } + }, + "core/src/main/java/hudson/tasks/BuildTrigger.java": { + "322": { + "Vulnerability Introducing Commit": [ + "a275556df61047f702276ce2ad9cb94fbfefc1a6" + ] + } + }, + "core/src/main/resources/lib/hudson/project/config-upstream-pseudo-trigger.jelly": { + "41": { + "Vulnerability Introducing Commit": [ + "f7ce7ccbf9aec2da95e5a59743dc20c41e1550c4" + ] + } + } + } + } + }, + "CVE-2014-2058": { + "cwe": "CWE-264", + "fixing_commits": { + "b6b2a367a7976be80a799c6a49fa6c58d778b50e": { + "core/src/main/java/hudson/model/AbstractProject.java": { + "1942": { + "Vulnerability Introducing Commit": [ + "36342d71e29e0620f803a7470ce96c61761648d8" + ] + } + } + } + } + }, + "CVE-2014-2064": { + "cwe": "CWE-200", + "fixing_commits": { + "fbf96734470caba9364f04e0b77b0bae7293a1ec": { + "core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java": { + "176": { + "Vulnerability Introducing Commit": [ + "1952937655c28bf5e523b8ea806dba504e76d65f" + ] + }, + "177": { + "Vulnerability Introducing Commit": [ + "1952937655c28bf5e523b8ea806dba504e76d65f" + ] + } + } + } + } + }, + "CVE-2014-2065": { + "cwe": "CWE-79", + "fixing_commits": { + "a0b00508eeb74d7033dc4100eb382df4e8fa72e7": { + "core/src/main/java/hudson/model/View.java": { + "769": { + "Vulnerability Introducing Commit": [ + "eb1a1ffa9432318afba67ada4cf8ba2b5d573bfd" + ] + } + }, + "core/src/main/java/jenkins/model/Jenkins.java": { + "3420": { + "Vulnerability Introducing Commit": [ + "70c10658148c3eab3b4c4122705e1ed3a12e193d" + ] + }, + "3422": { + "Vulnerability Introducing Commit": [ + "70c10658148c3eab3b4c4122705e1ed3a12e193d" + ] + }, + "3967": { + "Vulnerability Introducing Commit": [ + "70c10658148c3eab3b4c4122705e1ed3a12e193d" + ] + } + }, + "core/src/main/resources/lib/hudson/setIconSize.jelly": { + "30": { + "Vulnerability Introducing Commit": [ + "efbb3fcc84055c854cd12dbe683304a03e88d14c" + ] + } + } + } + } + }, + "CVE-2014-2067": { + "cwe": "CWE-79", + "fixing_commits": { + "5d57c855f3147bfc5e7fda9252317b428a700014": { + "core/src/main/java/hudson/model/Cause.java": { + "374": { + "Vulnerability Introducing Commit": [ + "910bcfa5b8743a2226cc7364130b6de10f120334" + ] + }, + "375": { + "Vulnerability Introducing Commit": [ + "910bcfa5b8743a2226cc7364130b6de10f120334" + ] + }, + "376": { + "Vulnerability Introducing Commit": [ + "e59283e65c0049fa1ab9028bb28fe01534ae38b5" + ] + } + } + } + } + }, + "CVE-2014-2068": { + "cwe": "CWE-264", + "fixing_commits": { + "0530a6645aac10fec005614211660e98db44b5eb": { + "core/src/main/java/hudson/util/RemotingDiagnostics.java": { + "205": { + "Vulnerability Introducing Commit": [ + "6784369b13c598fcd85c06f28d1a7d76cc20dcc8" + ] + } + } + } + } + }, + "CVE-2015-8103": { + "cwe": "CWE-77", + "fixing_commits": { + "5bd9b55a2a3249939fd78c501b8959a804c1164b": { + "cli/src/main/java/hudson/cli/Connection.java": { + "110": { + "Vulnerability Introducing Commit": [ + "0d4117e48fe1152c07ab49dd9b662eb14a459e58" + ] + } + }, + "core/src/main/java/hudson/util/ReflectionUtils.java": { + "125": { + "Vulnerability Introducing Commit": [ + "089f66504ed766cb09ea10c706eb86dfa35dad6d" + ] + } + }, + "pom.xml": { + "177": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2017-1000391": { + "cwe": "CWE-20", + "fixing_commits": { + "566a8ddb885f0bef9bc848e60455c0aabbf0c1d3": { + "core/src/main/java/jenkins/model/IdStrategy.java": { + "206": { + "Vulnerability Introducing Commit": [ + "1c6734098ca068b66bbd1abab30353d7a4f1c5e4" + ] + } + } + } + } + }, + "CVE-2017-1000395": { + "cwe": "CWE-200", + "fixing_commits": { + "7b1f8e96a8d97dd09e5e093fcdb010b3295acc77": { + "core/src/main/java/hudson/model/User.java": { + "292": { + "Vulnerability Introducing Commit": [ + "f09983ec8fc95bd85e7cacba33253ac88ff227b3" + ] + } + } + } + } + }, + "CVE-2017-1000398": { + "cwe": "CWE-200", + "fixing_commits": { + "da06fd471cea79123821c778228eeb08e1cedcc7": { + "core/src/main/java/hudson/model/Executor.java": { + "486": { + "Vulnerability Introducing Commit": [ + "bf3c016358b3a5ebc8626d1952c55a5988239ece" + ] + }, + "513": { + "Vulnerability Introducing Commit": [ + "cc38c6561b434d1b3bcb393cc67ed73f6cb50d73" + ] + } + }, + "core/src/main/java/hudson/model/queue/WorkUnit.java": { + "42": { + "Vulnerability Introducing Commit": [ + "92a2c48fab69b08eb0b9e3b8ff9a202d2c6ad09c" + ] + } + } + } + } + }, + "CVE-2017-1000400": { + "cwe": "CWE-862", + "fixing_commits": { + "b2083a387a5bdb6f7ee7f7c81a1f6312aca2a558": { + "core/src/main/java/hudson/model/AbstractBuild.java": { + "1111": { + "Vulnerability Introducing Commit": [ + "db430b3896faf78023ecf03b043469a50bbf24e6" + ] + } + }, + "core/src/main/java/hudson/model/AbstractProject.java": { + "1648": { + "Vulnerability Introducing Commit": [ + "91336442ff91bcb5fe3a45a18a41fac9e337aa98" + ] + }, + "1653": { + "Vulnerability Introducing Commit": [ + "91336442ff91bcb5fe3a45a18a41fac9e337aa98" + ] + } + } + } + } + }, + "CVE-2018-1000406": { + "cwe": "CWE-22", + "fixing_commits": { + "c3351d2e7c3edfee82b9470e9aa1168982296072": { + "core/src/main/java/hudson/model/FileParameterValue.java": { + "145": { + "Vulnerability Introducing Commit": [ + "e96c8f8f84b05e4c760d5eaede5725dd6068659c" + ] + }, + "230": { + "Vulnerability Introducing Commit": [ + "e96c8f8f84b05e4c760d5eaede5725dd6068659c" + ] + } + } + } + } + }, + "CVE-2018-1999044": { + "cwe": "CWE-835", + "fixing_commits": { + "e5046911c57e60a1d6d8aca9b21bd9093b0f3763": { + "core/src/main/java/hudson/scheduler/CronTab.java": { + "207": { + "Vulnerability Introducing Commit": [ + "350bf691654b9d2700322964179b155b02c83c14" + ] + } + } + } + } + } + }, + "junit-plugin": { + "CVE-2018-1000056": { + "cwe": "CWE-918", + "fixing_commits": { + "15f39fc49d9f25bca872badb48e708a8bb815ea7": { + "src/main/java/hudson/tasks/junit/XMLEntityResolver.java": { + "70": { + "Vulnerability Introducing Commit": [ + "50869a1742b887e134a3a684d4c1dbf90ae6b9a9" + ] + } + } + } + } + } + }, + "karaf": { + "CVE-2018-11787": { + "cwe": "CWE-287", + "fixing_commits": { + "434e52502528e91e20d2f87cec7732f1e6e554c2": { + "webconsole/features/src/main/java/org/apache/karaf/webconsole/features/Activator.java": { + "45": { + "Vulnerability Introducing Commit": [ + "f032ce95d41c50e01eb785ecd921eedef9b40d9e" + ] + } + }, + "webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/Activator.java": { + "44": { + "Vulnerability Introducing Commit": [ + "f032ce95d41c50e01eb785ecd921eedef9b40d9e" + ] + } + }, + "webconsole/instance/src/main/java/org/apache/karaf/webconsole/instance/Activator.java": { + "44": { + "Vulnerability Introducing Commit": [ + "f032ce95d41c50e01eb785ecd921eedef9b40d9e" + ] + } + } + }, + "cfa213ad680ded70b70bf0c648891a06386ef632": { + "webconsole/features/src/main/java/org/apache/karaf/webconsole/features/Activator.java": { + "45": { + "Vulnerability Introducing Commit": [ + "f032ce95d41c50e01eb785ecd921eedef9b40d9e" + ] + } + }, + "webconsole/gogo/src/main/java/org/apache/karaf/webconsole/gogo/Activator.java": { + "44": { + "Vulnerability Introducing Commit": [ + "f032ce95d41c50e01eb785ecd921eedef9b40d9e" + ] + } + }, + "webconsole/instance/src/main/java/org/apache/karaf/webconsole/instance/Activator.java": { + "44": { + "Vulnerability Introducing Commit": [ + "f032ce95d41c50e01eb785ecd921eedef9b40d9e" + ] + } + } + } + } + } + }, + "linux-kernel": { + "CVE-2008-3831": { + "cwe": "CWE-399", + "fixing_commits": { + "4b40893918203ee1a1f6a114316c2a19c072e9bd": { + "drivers/gpu/drm/i915/i915_dma.c": { + "943": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2009-1385": { + "cwe": "CWE-189", + "fixing_commits": { + "ea30e11970a96cfe5e32c03a29332554573b4a10": { + "drivers/net/e1000/e1000_main.c": { + "4031": { + "Vulnerability Introducing Commit": [ + "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2" + ] + } + } + } + } + }, + "CVE-2009-4410": { + "cwe": "NVD-CWE-Other", + "fixing_commits": { + "0bd87182d3ab18a32a8e9175d3f68754c58e3432": { + "fs/fuse/file.c": { + "1603": { + "Vulnerability Introducing Commit": [ + "59efec7b903987dcb60b9ebc85c7acd4443a11a1" + ] + } + } + } + } + }, + "CVE-2010-4263": { + "cwe": "CWE-476", + "fixing_commits": { + "31b24b955c3ebbb6f3008a6374e61cf7c05a193c": { + "drivers/net/igb/igb_main.c": { + "5105": { + "Vulnerability Introducing Commit": [ + "d3352520273426e4c16e91d189aa8aa7ee5e96c5" + ] + } + } + } + } + }, + "CVE-2011-0716": { + "cwe": "CWE-399", + "fixing_commits": { + "6b0d6a9b4296fa16a28d10d416db7a770fc03287": { + "net/bridge/br_multicast.c": { + "722": { + "Vulnerability Introducing Commit": [ + "eb1d16414339a6e113d89e2cca2556005d7ce919" + ] + } + } + } + } + }, + "CVE-2011-1759": { + "cwe": "CWE-189", + "fixing_commits": { + "0f22072ab50cac7983f9660d33974b45184da4f9": { + "arch/arm/kernel/sys_oabi-compat.c": { + "314": { + "Vulnerability Introducing Commit": [ + "687ad0191488a067b3b3cc94f670cc21f93811e1" + ] + } + } + } + } + }, + "CVE-2013-0349": { + "cwe": "CWE-200", + "fixing_commits": { + "0a9ab9bdb3e891762553f667066190c1d22ad62b": { + "net/bluetooth/hidp/core.c": { + "934": { + "Vulnerability Introducing Commit": [ + "e1aaadd4d8162a2c33e41dd5a72234ea4d3b014f" + ] + } + } + } + } + }, + "CVE-2014-0155": { + "cwe": "CWE-20", + "fixing_commits": { + "5678de3f15010b9022ee45673f33bcfc71d47b60": { + "virt/kvm/ioapic.c": { + "359": { + "Vulnerability Introducing Commit": [ + "2c2bf01136971c33e3b3fabce23925f372c1017e" + ] + } + } + } + } + }, + "CVE-2014-0203": { + "cwe": "CWE-416", + "fixing_commits": { + "86acdca1b63e6890540fa19495cfc708beff3d8b": { + "fs/proc/base.c": { + "1422": { + "Vulnerability Introducing Commit": [ + "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2" + ] + } + } + } + } + }, + "CVE-2015-2922": { + "cwe": "CWE-17", + "fixing_commits": { + "6fd99094de2b83d1d4c8457f2c83483b2828e75a": { + "net/ipv6/ndisc.c": { + "1221": { + "Vulnerability Introducing Commit": [ + "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2" + ] + } + } + } + } + }, + "CVE-2015-4170": { + "cwe": "CWE-362", + "fixing_commits": { + "cf872776fc84128bb779ce2b83a37c884c3203ae": { + "drivers/tty/tty_ldsem.c": { + "91": { + "Vulnerability Introducing Commit": [ + "4898e640caf03fdbaf2122d5a33949bf3e4a5b34" + ] + }, + "93": { + "Vulnerability Introducing Commit": [ + "4898e640caf03fdbaf2122d5a33949bf3e4a5b34" + ] + } + } + } + } + }, + "CVE-2015-5156": { + "cwe": "CWE-119", + "fixing_commits": { + "48900cb6af4282fa0fb6ff4d72a81aa3dadb5c39": { + "drivers/net/virtio_net.c": { + "1759": { + "Vulnerability Introducing Commit": [ + "98e778c9aa4f4f75550fa3a31358304e4ce67b96" + ] + }, + "1761": { + "Vulnerability Introducing Commit": [ + "296f96fcfc160e29c01819c0c7b20c2dc8320edd" + ] + } + } + } + } + }, + "CVE-2015-8215": { + "cwe": "CWE-20", + "fixing_commits": { + "77751427a1ff25b27d47a4c36b12c3c8667855ac": { + "net/ipv6/addrconf.c": { + "5057": { + "Vulnerability Introducing Commit": [ + "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2" + ] + } + } + } + } + }, + "CVE-2016-2549": { + "cwe": "CWE-20", + "fixing_commits": { + "2ba1fe7a06d3624f9a7586d672b55f08f7c670f3": { + "sound/core/hrtimer.c": { + "93": { + "Vulnerability Introducing Commit": [ + "bbaf5e97337287479eb78dbc3822d9560bbfd2e2" + ] + } + } + } + } + }, + "CVE-2017-13220": { + "cwe": "CWE-843", + "fixing_commits": { + "51bda2bca53b265715ca1852528f38dc67429d9a": { + "net/bluetooth/hidp/core.c": { + "1317": { + "Vulnerability Introducing Commit": [ + "b4f34d8d9d26b2428fa7cf7c8f97690a297978e6" + ] + } + } + } + } + }, + "CVE-2017-5986": { + "cwe": "CWE-617", + "fixing_commits": { + "2dcab598484185dea7ec22219c76dcdd59e3cb90": { + "net/sctp/socket.c": { + "7429": { + "Vulnerability Introducing Commit": [ + "61c9fed41638249f8b6ca5345064eb1beb50179f" + ] + } + } + } + } + }, + "CVE-2017-8924": { + "cwe": "CWE-191", + "fixing_commits": { + "654b404f2a222f918af9b0cd18ad469d0c941a8e": { + "drivers/usb/serial/io_ti.c": { + "1764": { + "Vulnerability Introducing Commit": [ + "1da177e4c3f41524e886b7f1b8a0c1fc7321cac2" + ] + } + } + } + } + }, + "CVE-2018-10940": { + "cwe": "CWE-119", + "fixing_commits": { + "9de4ee40547fd315d4a0ed1dd15a2fa3559ad707": { + "drivers/cdrom/cdrom.c": { + "2374": { + "Vulnerability Introducing Commit": [ + "d2c5d4fc07a41a6048b01d3b2930aeff1235fda5" + ] + } + } + } + } + }, + "CVE-2018-9518": { + "cwe": "CWE-787", + "fixing_commits": { + "fe9c842695e26d8116b61b80bfb905356f07834b": { + "net/nfc/netlink.c": { + "64": { + "Vulnerability Introducing Commit": [ + "d9b8d8e19b073096d3609bbd60f82148d128b555" + ] + } + } + } + } + }, + "CVE-2019-11085": { + "cwe": "CWE-20", + "fixing_commits": { + "51b00d8509dc69c98740da2ad07308b630d3eb7d": { + "drivers/gpu/drm/i915/gvt/kvmgt.c": { + "999": { + "Vulnerability Introducing Commit": [] + }, + "1017": { + "Vulnerability Introducing Commit": [] + } + } + } + } + } + }, + "lucene-solr": { + "CVE-2013-6408": { + "cwe": "NVD-CWE-noinfo", + "fixing_commits": { + "7239a57a51ea0f4d05dd330ce5e15e4f72f72747": { + "solr/core/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java": { + "106": { + "Vulnerability Introducing Commit": [ + "129dcfc99bc069e791e792cb3dd7a31f8f4d6842" + ] + } + } + } + } + } + }, + "mercurial-plugin": { + "CVE-2018-1000112": { + "cwe": "CWE-863", + "fixing_commits": { + "54b4f82e80c89d51b12bc64258f6b59e98b0c16a": { + "src/main/java/hudson/plugins/mercurial/MercurialStatus.java": { + "45": { + "Vulnerability Introducing Commit": [ + "df5d889792a9ed9af8f42b4a8142bf0a2224058c" + ] + }, + "53": { + "Vulnerability Introducing Commit": [ + "df5d889792a9ed9af8f42b4a8142bf0a2224058c" + ] + }, + "54": { + "Vulnerability Introducing Commit": [ + "df5d889792a9ed9af8f42b4a8142bf0a2224058c" + ] + }, + "55": { + "Vulnerability Introducing Commit": [ + "df5d889792a9ed9af8f42b4a8142bf0a2224058c" + ] + } + } + } + } + } + }, + "nifi": { + "CVE-2018-1309": { + "cwe": "CWE-611", + "fixing_commits": { + "28067a29fd13cdf8e21b440fc65c6dd67872522f": { + "nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitXml.java": { + "178": { + "Vulnerability Introducing Commit": [ + "4d998c12c95a6e5ce3d66c0d861e75e33b5cf013" + ] + }, + "179": { + "Vulnerability Introducing Commit": [ + "4d998c12c95a6e5ce3d66c0d861e75e33b5cf013" + ] + }, + "181": { + "Vulnerability Introducing Commit": [ + "4d998c12c95a6e5ce3d66c0d861e75e33b5cf013" + ] + }, + "182": { + "Vulnerability Introducing Commit": [ + "4d998c12c95a6e5ce3d66c0d861e75e33b5cf013" + ] + }, + "183": { + "Vulnerability Introducing Commit": [ + "4d998c12c95a6e5ce3d66c0d861e75e33b5cf013" + ] + } + } + } + } + }, + "CVE-2018-17192": { + "cwe": "CWE-1021", + "fixing_commits": { + "dbf259508c2b8e176d8cb837177aaadbf44f0670": { + "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java": { + "1036": { + "Vulnerability Introducing Commit": [ + "ac8e57259f8e4d8183d938f46a28f3c73b595940" + ] + } + } + } + } + } + }, + "onos": { + "CVE-2018-1999020": { + "cwe": "CWE-22", + "fixing_commits": { + "4b19da6ce94de4865a365c200d6e8169ffb2184f": { + "core/common/src/main/java/org/onosproject/common/app/ApplicationArchive.java": { + "242": { + "Vulnerability Introducing Commit": [ + "62ad95f3f1b7dfab11ba291dc25eb8c95d80dcc8" + ] + }, + "356": { + "Vulnerability Introducing Commit": [ + "02aeb0339f584153798906c5f3a1c2809ead511e" + ] + }, + "440": { + "Vulnerability Introducing Commit": [ + "6cc7488d9423a18ba5454ec88c2a4a2b8ec4383d" + ] + }, + "502": { + "Vulnerability Introducing Commit": [ + "02aeb0339f584153798906c5f3a1c2809ead511e" + ] + } + } + } + } + } + }, + "OpenSSL": { + "CVE-2000-1254": { + "cwe": "CWE-310", + "fixing_commits": { + "db82b8f9bd432a59aea8e1014694e15fc457c2bb": { + "crypto/rsa/rsa_gen.c": { + "98": { + "Vulnerability Introducing Commit": [ + "dfeab0689f69c0b4bd3480ffd37a9cacc2f17d9c" + ] + } + } + } + } + }, + "CVE-2009-1378": { + "cwe": "CWE-399", + "fixing_commits": { + "abda7c114791fa7fe95672ec7a66fc4733c40dbc": { + "ssl/d1_both.c": { + "565": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2009-1379": { + "cwe": "CWE-399", + "fixing_commits": { + "561cbe567846a376153bea7f1f2d061e78029c2d": { + "ssl/d1_both.c": { + "539": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2009-3245": { + "cwe": "CWE-20", + "fixing_commits": { + "7e4cae1d2f555cbe9226b377aff4b56c9f7ddd4d": { + "crypto/bn/bn_mul.c": { + "1035": { + "Vulnerability Introducing Commit": [ + "6a2347ee45927c595847e797778af2031cba8e0d" + ] + }, + "1036": { + "Vulnerability Introducing Commit": [ + "6a2347ee45927c595847e797778af2031cba8e0d" + ] + }, + "1042": { + "Vulnerability Introducing Commit": [ + "6a2347ee45927c595847e797778af2031cba8e0d" + ] + }, + "1043": { + "Vulnerability Introducing Commit": [ + "6a2347ee45927c595847e797778af2031cba8e0d" + ] + } + } + } + } + }, + "CVE-2013-6449": { + "cwe": "CWE-310", + "fixing_commits": { + "ca989269a2876bae79393bd54c3e72d49975fc75": { + "ssl/s3_lib.c": { + "4289": { + "Vulnerability Introducing Commit": [ + "9472baae0d17ddf425f891a3154057356217af08" + ] + } + } + } + } + }, + "CVE-2014-0221": { + "cwe": "CWE-399", + "fixing_commits": { + "d3152655d5319ce883c8e3ac4b99f8de4c59d846": { + "ssl/d1_both.c": { + "854": { + "Vulnerability Introducing Commit": [ + "36d16f8ee0845d932e250286e8e236580470e35b" + ] + }, + "855": { + "Vulnerability Introducing Commit": [ + "36d16f8ee0845d932e250286e8e236580470e35b" + ] + } + } + } + } + }, + "CVE-2015-0205": { + "cwe": "CWE-310", + "fixing_commits": { + "1421e0c584ae9120ca1b88098f13d6d2e90b83a3": { + "ssl/s3_srvr.c": { + "3059": { + "Vulnerability Introducing Commit": [ + "d02b48c63a58ea4367a0e905979f140b7d090f86" + ] + } + } + } + } + }, + "CVE-2015-0208": { + "cwe": "NVD-CWE-Other", + "fixing_commits": { + "4b22cce3812052fe64fc3f6d58d8cc884e3cb834": { + "crypto/rsa/rsa_ameth.c": { + "701": { + "Vulnerability Introducing Commit": [ + "af7d6b936b4020cf433a0bb20f911f9e03576e50" + ] + } + } + } + } + }, + "CVE-2015-0290": { + "cwe": "CWE-17", + "fixing_commits": { + "77c77f0a1b9f15b869ca3342186dfbedd1119d0e": { + "ssl/s3_pkt.c": { + "788": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2015-1787": { + "cwe": "CWE-20", + "fixing_commits": { + "b19d8143212ae5fbc9cebfd51c01f802fabccd33": { + "ssl/s3_srvr.c": { + "2254": { + "Vulnerability Introducing Commit": [ + "c523eb98d1694afd5d73cb5fe3b521c6064c130f" + ] + }, + "2256": { + "Vulnerability Introducing Commit": [ + "7493bcc659a6d1cff73d7974f18a73331e978657" + ] + } + } + } + } + }, + "CVE-2015-3194": { + "cwe": "NVD-CWE-Other", + "fixing_commits": { + "c394a488942387246653833359a5c94b5832674e": { + "crypto/rsa/rsa_ameth.c": { + "271": { + "Vulnerability Introducing Commit": [ + "af7d6b936b4020cf433a0bb20f911f9e03576e50" + ] + } + } + } + } + }, + "CVE-2016-2105": { + "cwe": "CWE-189", + "fixing_commits": { + "5b814481f3573fa9677f3a31ee51322e2a22ee6a": { + "crypto/evp/encode.c": { + "160": { + "Vulnerability Introducing Commit": [ + "d02b48c63a58ea4367a0e905979f140b7d090f86" + ] + } + } + } + } + }, + "CVE-2016-2106": { + "cwe": "CWE-189", + "fixing_commits": { + "3f3582139fbb259a1c3cbb0a25236500a409bf26": { + "crypto/evp/evp_enc.c": { + "335": { + "Vulnerability Introducing Commit": [ + "d02b48c63a58ea4367a0e905979f140b7d090f86" + ] + } + } + } + } + }, + "CVE-2016-2182": { + "cwe": "CWE-787", + "fixing_commits": { + "07bed46f332fce8c1d157689a2cdf915a982ae34": { + "crypto/bn/bn_print.c": { + "74": { + "Vulnerability Introducing Commit": [ + "58964a492275ca9a59a0cd9c8155cb2491b4b909" + ] + } + } + } + } + }, + "CVE-2016-6302": { + "cwe": "CWE-20", + "fixing_commits": { + "e97763c92c655dcf4af2860b3abd2bc4c8a267f9": { + "ssl/t1_lib.c": { + "2973": { + "Vulnerability Introducing Commit": [ + "6434abbfc6ac0d5cb882844ed10fef5821039cf6" + ] + }, + "2974": { + "Vulnerability Introducing Commit": [ + "c519e89f5c359b8c0f747519773284d9b6382791" + ] + } + } + } + } + }, + "CVE-2016-6303": { + "cwe": "CWE-787", + "fixing_commits": { + "55d83bf7c10c7b205fffa23fa7c3977491e56c07": { + "crypto/mdc2/mdc2dgst.c": { + "45": { + "Vulnerability Introducing Commit": [ + "d02b48c63a58ea4367a0e905979f140b7d090f86" + ] + } + } + } + } + }, + "CVE-2016-6309": { + "cwe": "CWE-416", + "fixing_commits": { + "acacbfa7565c78d2273c0b2a2e5e803f44afefeb": { + "ssl/statem/statem.c": { + "548": { + "Vulnerability Introducing Commit": [ + "4b390b6c3f8df925dc92a3dd6b022baa9a2f4650" + ] + }, + "549": { + "Vulnerability Introducing Commit": [ + "4b390b6c3f8df925dc92a3dd6b022baa9a2f4650" + ] + }, + "550": { + "Vulnerability Introducing Commit": [ + "4b390b6c3f8df925dc92a3dd6b022baa9a2f4650" + ] + } + } + } + } + }, + "CVE-2016-7052": { + "cwe": "CWE-476", + "fixing_commits": { + "6e629b5be45face20b4ca71c4fcbfed78b864a2e": { + "crypto/x509/x509_vfy.c": { + "1127": { + "Vulnerability Introducing Commit": [ + "bc7535bc7fe30fbba222c316a3957da7d906603b" + ] + }, + "1130": { + "Vulnerability Introducing Commit": [ + "325da8231c8d441e6bb7f15d1a5a23ff63c842e5" + ] + } + } + } + } + }, + "CVE-2017-3737": { + "cwe": "CWE-125", + "fixing_commits": { + "898fb884b706aaeb283de4812340bb0bde8476dc": { + "ssl/ssl.h": { + "1730": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2018-0732": { + "cwe": "CWE-320", + "fixing_commits": { + "3984ef0b72831da8b3ece4745cac4f8575b19098": { + "crypto/dh/dh_key.c": { + "133": { + "Vulnerability Introducing Commit": [ + "d02b48c63a58ea4367a0e905979f140b7d090f86" + ] + } + } + } + } + } + }, + "opentsdb": { + "CVE-2018-12972": { + "cwe": "CWE-78", + "fixing_commits": { + "a6a9ec4bc8a526951bc25bb19a145782bafaa8b0": { + "src/query/expression/ExpressionIterator.java": { + "341": { + "Vulnerability Introducing Commit": [ + "35717b127ef9cee78918bbdf04558c9564c9555d" + ] + }, + "343": { + "Vulnerability Introducing Commit": [ + "35717b127ef9cee78918bbdf04558c9564c9555d" + ] + }, + "468": { + "Vulnerability Introducing Commit": [ + "35717b127ef9cee78918bbdf04558c9564c9555d" + ] + } + } + } + } + } + }, + "ovirt-engine": { + "CVE-2018-1062": { + "cwe": "CWE-212", + "fixing_commits": { + "820888c4e8dfbe79dc55e1ba8e72edb0ebd88906": { + "backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/GetDeviceListVDSCommand.java": { + "174": { + "Vulnerability Introducing Commit": [ + "831d6d4d416abdbec21ace4aeb1086fe2cb60fe3" + ] + } + }, + "backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/vdsbroker/GetDeviceListVDSCommandTest.java": { + "113": { + "Vulnerability Introducing Commit": [] + } + } + }, + "d0e33ace71b7603450fc1aa7725f53dbc5458318": { + "backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/GetDeviceListVDSCommand.java": { + "174": { + "Vulnerability Introducing Commit": [ + "831d6d4d416abdbec21ace4aeb1086fe2cb60fe3" + ] + } + }, + "backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/vdsbroker/vdsbroker/GetDeviceListVDSCommandTest.java": { + "111": { + "Vulnerability Introducing Commit": [] + } + } + } + } + } + }, + "php-src": { + "CVE-2008-0599": { + "cwe": "NVD-CWE-Other", + "fixing_commits": { + "183267dc2916d1bcd7673fc8285f3fc1fc414462": { + "sapi/cgi/cgi_main.c": { + "1104": { + "Vulnerability Introducing Commit": [ + "30dd6a45d31cab020dad553bb7b6d4c499b01441" + ] + } + } + } + } + }, + "CVE-2012-2329": { + "cwe": "CWE-119", + "fixing_commits": { + "20364bcff9f38bed83245d785cc8ec3a072e4da5": { + "sapi/cgi/cgi_main.c": { + "1620": { + "Vulnerability Introducing Commit": [ + "a95dd97752d73c213d21ce97200e64e3ff6f40f0" + ] + }, + "1623": { + "Vulnerability Introducing Commit": [ + "a95dd97752d73c213d21ce97200e64e3ff6f40f0" + ] + } + } + } + } + }, + "CVE-2013-7456": { + "cwe": "CWE-125", + "fixing_commits": { + "7a1aac3343af85b4af4df5f8844946eaa27394ab": { + "ext/gd/libgd/gd_interpolation.c": { + "937": { + "Vulnerability Introducing Commit": [ + "a7a53d369bfcf3208b445b9aa12aa8a6e114c5fd" + ] + }, + "938": { + "Vulnerability Introducing Commit": [ + "a7a53d369bfcf3208b445b9aa12aa8a6e114c5fd" + ] + } + } + } + } + }, + "CVE-2014-0238": { + "cwe": "CWE-119", + "fixing_commits": { + "57225f09edd671db50137194cb83530884cb6030": { + "ext/fileinfo/libmagic/cdf.c": { + "900": { + "Vulnerability Introducing Commit": [ + "7a29c8f38677d1c7474c979836562488f6bbadec" + ] + } + } + } + } + }, + "CVE-2014-2497": { + "cwe": "CWE-399", + "fixing_commits": { + "cf4753691dc55999373d1c576f62ecb298723420": { + "ext/gd/libgd/gdxpm.c": { + "39": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2014-3487": { + "cwe": "CWE-20", + "fixing_commits": { + "2fe5bcbeb58bb1088f9fcdb9f02599880454b602": { + "ext/fileinfo/libmagic/cdf.c": { + "815": { + "Vulnerability Introducing Commit": [ + "12cf930a403d0bbee0c40a5e93554cafd6b0895e" + ] + } + } + } + } + }, + "CVE-2014-3587": { + "cwe": "CWE-189", + "fixing_commits": { + "cba5120407fbd0735b9aac5ede2fd02bdfab46a9": { + "ext/fileinfo/libmagic/cdf.c": { + "823": { + "Vulnerability Introducing Commit": [ + "7a29c8f38677d1c7474c979836562488f6bbadec" + ] + } + } + } + } + }, + "CVE-2014-3981": { + "cwe": "CWE-59", + "fixing_commits": { + "08334293f8883c2bcbb74ed10b8133672fee8706": { + "acinclude.m4": { + "1703": { + "Vulnerability Introducing Commit": [ + "a28eaf64d0795f305644542c819fa34d73e785f1" + ] + } + } + } + } + }, + "CVE-2014-9427": { + "cwe": "CWE-119", + "fixing_commits": { + "f9ad3086693fce680fbe246e4a45aa92edd2ac35": { + "sapi/cgi/cgi_main.c": { + "2432": { + "Vulnerability Introducing Commit": [ + "b4216e0a82f509532513a9a6bc1882b75918f341" + ] + }, + "2436": { + "Vulnerability Introducing Commit": [ + "b4216e0a82f509532513a9a6bc1882b75918f341" + ] + } + } + } + } + }, + "CVE-2014-9912": { + "cwe": "CWE-119", + "fixing_commits": { + "e644aad3f9138bbb2e77520f033ba902f236b8b5": { + "ext/intl/locale/locale_methods.c": { + "501": { + "Vulnerability Introducing Commit": [ + "0d16b1516b6b9ef0c2696bc19069e4cda5aee0ea" + ] + } + } + } + } + }, + "CVE-2015-2331": { + "cwe": "CWE-189", + "fixing_commits": { + "4a8d8b4154334b1714e19b82b061201d41dc87d6": { + "ext/zip/lib/zip_dirent.c": { + "104": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2015-4021": { + "cwe": "CWE-189", + "fixing_commits": { + "c27f012b7a447e59d4a704688971cbfa7dddaa74": { + "ext/phar/tar.c": { + "428": { + "Vulnerability Introducing Commit": [ + "16b4d8e0e1108564fa042520171d9091af708d83" + ] + } + } + } + } + }, + "CVE-2015-5589": { + "cwe": "CWE-20", + "fixing_commits": { + "bf58162ddf970f63502837f366930e44d6a992cf": { + "ext/phar/phar_object.c": { + "2422": { + "Vulnerability Introducing Commit": [ + "d1eda9c8acbd6a231012f22b124fda6d7242018c" + ] + } + } + } + } + }, + "CVE-2015-5590": { + "cwe": "CWE-119", + "fixing_commits": { + "6dedeb40db13971af45276f80b5375030aa7e76f": { + "ext/phar/phar.c": { + "2145": { + "Vulnerability Introducing Commit": [ + "c6aa379d74535bf5e245fa9941b235498f987196" + ] + }, + "2235": { + "Vulnerability Introducing Commit": [ + "c6aa379d74535bf5e245fa9941b235498f987196" + ] + } + } + } + } + }, + "CVE-2015-7803": { + "cwe": "NVD-CWE-Other", + "fixing_commits": { + "d698f0ae51f67c9cce870b09c59df3d6ba959244": { + "ext/phar/util.c": { + "497": { + "Vulnerability Introducing Commit": [ + "44cb95a53d199b7f06eedcc07f1a839ada4e795d" + ] + } + } + } + } + }, + "CVE-2015-7804": { + "cwe": "CWE-189", + "fixing_commits": { + "e78ac461dbefb7c4a3e9fde78d50fbc56b7b0183": { + "ext/phar/dirstream.c": { + "210": { + "Vulnerability Introducing Commit": [ + "16b4d8e0e1108564fa042520171d9091af708d83" + ] + } + } + } + } + }, + "CVE-2016-3078": { + "cwe": "CWE-190", + "fixing_commits": { + "3b8d4de300854b3517c7acb239b84f7726c1353c": { + "ext/zip/php_zip.c": { + "1284": { + "Vulnerability Introducing Commit": [ + "c3e3c98ec666812daaaca896cf5ef758a8a6df14" + ] + }, + "2731": { + "Vulnerability Introducing Commit": [ + "c3e3c98ec666812daaaca896cf5ef758a8a6df14" + ] + } + } + } + } + }, + "CVE-2016-4542": { + "cwe": "CWE-119", + "fixing_commits": { + "082aecfc3a753ad03be82cf14f03ac065723ec92": { + "ext/exif/exif.c": { + "2968": { + "Vulnerability Introducing Commit": [ + "a3daf3bbe8be19e383fe81f170cb146faa694847" + ] + }, + "3211": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2016-6297": { + "cwe": "CWE-119", + "fixing_commits": { + "8ebdb1f5fd19cb15dd6ac7700c781ede5dcbba95": { + "ext/zip/zip_stream.c": { + "104": { + "Vulnerability Introducing Commit": [ + "3b337020fad89f0560aff3af3d0447d1ee1eaa66" + ] + }, + "110": { + "Vulnerability Introducing Commit": [ + "3b337020fad89f0560aff3af3d0447d1ee1eaa66" + ] + } + } + } + } + }, + "CVE-2018-14884": { + "cwe": "CWE-476", + "fixing_commits": { + "0e097f2c96ce31b16fa371981045f224e5a37160": { + "ext/standard/http_fopen_wrapper.c": { + "815": { + "Vulnerability Introducing Commit": [ + "5146d9f8ac170d8ba7109370d732d56dc0777578" + ] + }, + "819": { + "Vulnerability Introducing Commit": [ + "5146d9f8ac170d8ba7109370d732d56dc0777578" + ] + } + } + } + } + } + }, + "retrofit": { + "CVE-2018-1000850": { + "cwe": "CWE-22", + "fixing_commits": { + "b9a7f6ad72073ddd40254c0058710e87a073047d": { + "retrofit/src/main/java/retrofit2/RequestBuilder.java": { + "94": { + "Vulnerability Introducing Commit": [ + "7ddaabb80d098909e3c809c865f9938d8a6eb18e" + ] + } + } + } + } + } + }, + "shiro": { + "CVE-2016-6802": { + "cwe": "CWE-284", + "fixing_commits": { + "b15ab927709ca18ea4a02538be01919a19ab65af": { + "web/src/main/java/org/apache/shiro/web/util/WebUtils.java": { + "255": { + "Vulnerability Introducing Commit": [ + "9fd5bb2ec9c6106fd0843e80b28212f0dd973408" + ] + } + } + } + } + } + }, + "sonarqube": { + "CVE-2018-19413": { + "cwe": "CWE-200", + "fixing_commits": { + "7b567ba3d15ed7dd0b0bba0330686487e35af85c": { + "server/sonar-server/src/main/java/org/sonar/server/user/ws/SearchAction.java": { + "153": { + "Vulnerability Introducing Commit": [ + "90613366ab07018248f7c2974367bcb6afd37499" + ] + } + } + } + } + } + }, + "spring-amqp": { + "CVE-2017-8045": { + "cwe": "CWE-502", + "fixing_commits": { + "296d481f980fcbecbee01244e3644e254470a86e": { + "spring-amqp/src/main/java/org/springframework/amqp/core/Message.java": { + "80": { + "Vulnerability Introducing Commit": [ + "0d08676e161afb21b4e4c62985f8804fc20c5a4b" + ] + } + }, + "src/reference/asciidoc/amqp.adoc": { + "25": { + "Vulnerability Introducing Commit": [] + } + } + }, + "36e55998f6352ba3498be950ccab1d5f4d0ce655": { + "spring-amqp/src/main/java/org/springframework/amqp/core/Message.java": { + "81": { + "Vulnerability Introducing Commit": [ + "0d08676e161afb21b4e4c62985f8804fc20c5a4b" + ] + } + } + }, + "6e9e00bb5bf0aa88444146db3c2eae138cc7b0a1": { + "spring-amqp/src/main/java/org/springframework/amqp/core/Message.java": { + "80": { + "Vulnerability Introducing Commit": [ + "0d08676e161afb21b4e4c62985f8804fc20c5a4b" + ] + } + } + }, + "83fe9fdec2c86a57898d56c5e109debd9d5c07d9": { + "spring-amqp/src/main/java/org/springframework/amqp/core/Message.java": { + "77": { + "Vulnerability Introducing Commit": [ + "0d08676e161afb21b4e4c62985f8804fc20c5a4b" + ] + } + } + } + } + } + }, + "spring-cloud-sso-connector": { + "CVE-2018-1256": { + "cwe": "NVD-CWE-noinfo", + "fixing_commits": { + "ef647a2acf2363c6018e8543d665ac8862593372": { + "src/main/java/io/pivotal/spring/cloud/IssuerCheckConfiguration.java": { + "16": { + "Vulnerability Introducing Commit": [ + "c594317337457a7f19166244f6acc66b476be856" + ] + } + }, + "src/main/java/io/pivotal/spring/cloud/SsoServiceCredentialsListener.java": { + "38": { + "Vulnerability Introducing Commit": [ + "c594317337457a7f19166244f6acc66b476be856" + ] + } + }, + "src/test/java/io/pivotal/spring/cloud/IssuerCheckConfigurationTest.java": { + "22": { + "Vulnerability Introducing Commit": [] + }, + "23": { + "Vulnerability Introducing Commit": [] + } + }, + "src/test/java/io/pivotal/spring/cloud/SsoServiceCredentialsListenerTest.java": { + "51": { + "Vulnerability Introducing Commit": [] + } + } + } + } + } + }, + "spring-data-jpa": { + "CVE-2016-6652": { + "cwe": "CWE-89", + "fixing_commits": { + "b8e7fecccc7dc8edcabb4704656a7abe6352c08f": { + "src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java": { + "232": { + "Vulnerability Introducing Commit": [ + "b291a5f5f9928491567b3cb1b4a78d105c54af82" + ] + }, + "249": { + "Vulnerability Introducing Commit": [ + "a9cfe73511342c7f7d95a591bbf5ca1e7a8c1e86" + ] + } + } + } + } + } + }, + "spring-framework": { + "CVE-2013-4152": { + "cwe": "CWE-264", + "fixing_commits": { + "7576274874deeccb6da6b09a8d5bd62e8b5538b7": { + "spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.java": { + "229": { + "Vulnerability Introducing Commit": [ + "ed3823b045fd19cdb801609eb034c93dd4d75c3f" + ] + } + } + } + } + }, + "CVE-2013-7315": { + "cwe": "CWE-264", + "fixing_commits": { + "7576274874deeccb6da6b09a8d5bd62e8b5538b7": { + "spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2CollectionHttpMessageConverter.java": { + "229": { + "Vulnerability Introducing Commit": [ + "ed3823b045fd19cdb801609eb034c93dd4d75c3f" + ] + } + } + } + } + }, + "CVE-2015-0201": { + "cwe": "CWE-254", + "fixing_commits": { + "d63cfc8eebc396be009e733a81ebb4c984811f6e": { + "spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/SockJsUrlInfo.java": { + "36": { + "Vulnerability Introducing Commit": [ + "e82df99a22b7f511fc8e2c92a8a206e06d16bd62" + ] + } + } + } + } + } + }, + "spring-security": { + "CVE-2018-15801": { + "cwe": "CWE-345", + "fixing_commits": { + "c70b65c5df0e170a2d34d812b83db0b7bc71ea25": { + "oauth2/oauth2-jose/src/main/java/org/springframework/security/oauth2/jwt/JwtIssuerValidator.java": { + "40": { + "Vulnerability Introducing Commit": [ + "7c524aa0c8eb814fc9b86caca8cf290e2fcd9330" + ] + }, + "51": { + "Vulnerability Introducing Commit": [ + "7c524aa0c8eb814fc9b86caca8cf290e2fcd9330" + ] + }, + "66": { + "Vulnerability Introducing Commit": [ + "7c524aa0c8eb814fc9b86caca8cf290e2fcd9330" + ] + } + } + } + } + } + }, + "struts": { + "CVE-2012-4387": { + "cwe": "CWE-264", + "fixing_commits": { + "87935af56a27235e9399308ee1fcfb74f8edcefa": { + "xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java": { + "153": { + "Vulnerability Introducing Commit": [] + }, + "353": { + "Vulnerability Introducing Commit": [ + "0c543aef318341ca9bd482e15f1637497b8a4dfd" + ] + }, + "356": { + "Vulnerability Introducing Commit": [] + } + }, + "xwork-core/src/test/java/com/opensymphony/xwork2/interceptor/ParametersInterceptorTest.java": { + "204": { + "Vulnerability Introducing Commit": [] + } + } + } + } + }, + "CVE-2014-7809": { + "cwe": "CWE-352", + "fixing_commits": { + "1f301038a751bf16e525607c3db513db835b2999": { + "core/src/main/java/org/apache/struts2/util/TokenHelper.java": { + "54": { + "Vulnerability Introducing Commit": [ + "7a0a6d58016b244e9521442f1e9666521f5c61b9" + ] + } + } + } + } + }, + "CVE-2016-0785": { + "cwe": "CWE-20", + "fixing_commits": { + "15857a69e7baf3675804495a5954cd0756ac8364": { + "core/src/main/java/org/apache/struts2/components/Component.java": { + "376": { + "Vulnerability Introducing Commit": [ + "c01d3a92db7f71f751a0522912d24bcf4a94a1b0" + ] + } + }, + "core/src/main/java/org/apache/struts2/util/ComponentUtils.java": { + "46": { + "Vulnerability Introducing Commit": [ + "73494b036fbed01bc83febb65135cfae272dea8f" + ] + }, + "47": { + "Vulnerability Introducing Commit": [ + "73494b036fbed01bc83febb65135cfae272dea8f" + ] + } + }, + "core/src/main/java/org/apache/struts2/views/jsp/ui/AbstractUITag.java": { + "309": { + "Vulnerability Introducing Commit": [ + "73494b036fbed01bc83febb65135cfae272dea8f" + ] + } + } + } + } + }, + "CVE-2016-3087": { + "cwe": "CWE-20", + "fixing_commits": { + "6bd694b7980494c12d49ca1bf39f12aec3e03e2f": { + "core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java": { + "407": { + "Vulnerability Introducing Commit": [ + "c01d3a92db7f71f751a0522912d24bcf4a94a1b0" + ] + }, + "408": { + "Vulnerability Introducing Commit": [ + "c01d3a92db7f71f751a0522912d24bcf4a94a1b0" + ] + }, + "410": { + "Vulnerability Introducing Commit": [ + "c01d3a92db7f71f751a0522912d24bcf4a94a1b0" + ] + }, + "411": { + "Vulnerability Introducing Commit": [ + "c01d3a92db7f71f751a0522912d24bcf4a94a1b0" + ] + } + } + }, + "98d2692e434fe7f4d445ade24fe2c9860de1c13f": { + "core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java": { + "451": { + "Vulnerability Introducing Commit": [ + "c01d3a92db7f71f751a0522912d24bcf4a94a1b0" + ] + }, + "452": { + "Vulnerability Introducing Commit": [ + "c01d3a92db7f71f751a0522912d24bcf4a94a1b0" + ] + }, + "454": { + "Vulnerability Introducing Commit": [ + "c01d3a92db7f71f751a0522912d24bcf4a94a1b0" + ] + }, + "455": { + "Vulnerability Introducing Commit": [ + "c01d3a92db7f71f751a0522912d24bcf4a94a1b0" + ] + } + } + } + } + }, + "CVE-2016-8738": { + "cwe": "CWE-20", + "fixing_commits": { + "554b9dddb0fbd1e581ef577dd62a7c22955ad0f6": { + "core/src/main/java/com/opensymphony/xwork2/validator/validators/URLValidator.java": { + "58": { + "Vulnerability Introducing Commit": [ + "0c543aef318341ca9bd482e15f1637497b8a4dfd" + ] + } + } + } + } + }, + "CVE-2017-9805": { + "cwe": "CWE-502", + "fixing_commits": { + "19494718865f2fb7da5ea363de3822f87fbda264": { + "plugins/rest/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java": { + "38": { + "Vulnerability Introducing Commit": [ + "6229ad7a4726717bf594e9b4e4afa90e1e028829" + ] + }, + "45": { + "Vulnerability Introducing Commit": [ + "6229ad7a4726717bf594e9b4e4afa90e1e028829" + ] + } + } + }, + "6dd6e5cfb7b5e020abffe7e8091bd63fe97c10af": { + "plugins/rest/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java": { + "38": { + "Vulnerability Introducing Commit": [ + "6229ad7a4726717bf594e9b4e4afa90e1e028829" + ] + }, + "45": { + "Vulnerability Introducing Commit": [ + "6229ad7a4726717bf594e9b4e4afa90e1e028829" + ] + } + } + } + } + } + }, + "tikal-multijob-plugin": { + "CVE-2017-1000390": { + "cwe": "CWE-862", + "fixing_commits": { + "2424cec7a099fe4392f052a754fadc28de9f8d86": { + "src/main/java/com/tikal/jenkins/plugins/multijob/MultiJobResumeBuild.java": { + "18": { + "Vulnerability Introducing Commit": [ + "fa09157624e6661417e1b97f337c5037e85a6c84" + ] + }, + "27": { + "Vulnerability Introducing Commit": [ + "fa09157624e6661417e1b97f337c5037e85a6c84" + ] + } + } + }, + "3e6ab85019334a5b2a438264afdebe439cfc82b4": { + "src/main/java/com/tikal/jenkins/plugins/multijob/MultiJobResumeBuild.java": { + "28": { + "Vulnerability Introducing Commit": [ + "2424cec7a099fe4392f052a754fadc28de9f8d86" + ] + }, + "78": { + "Vulnerability Introducing Commit": [ + "2424cec7a099fe4392f052a754fadc28de9f8d86" + ] + } + } + } + } + } + }, + "tomcat": { + "CVE-2011-1582": { + "cwe": "CWE-264", + "fixing_commits": { + "299b26af66793438c323ea6b18462fa44683080f": { + "java/org/apache/catalina/core/StandardWrapper.java": { + "1139": { + "Vulnerability Introducing Commit": [ + "5fd4e9be3628708a9a9396c93a7297acc769350b" + ] + } + } + } + } + } + }, + "umlet": { + "CVE-2018-1000548": { + "cwe": "CWE-611", + "fixing_commits": { + "e1c4cc6ae692cc8d1c367460dbf79343e996f9bd": { + "umlet-swing/src/main/java/com/baselet/diagram/io/DiagramFileHandler.java": { + "249": { + "Vulnerability Introducing Commit": [ + "bc754fc8927f541bf3ff3e7c2889735641ae8e55" + ] + } + } + } + } + } + }, + "undertow": { + "CVE-2017-2670": { + "cwe": "CWE-835", + "fixing_commits": { + "9bfe9fbbb595d51157b61693f072895f7dbadd1d": { + "core/src/main/java/io/undertow/server/protocol/framed/AbstractFramedStreamSourceChannel.java": { + "288": { + "Vulnerability Introducing Commit": [ + "b6e3196e98e43d597221e901cb681efd5af442c8" + ] + } + } + } + } + }, + "CVE-2018-1114": { + "cwe": "CWE-400", + "fixing_commits": { + "7f22aa0090296eb00280f878e3731bb71d40f9eb": { + "core/src/main/java/io/undertow/server/handlers/resource/URLResource.java": { + "91": { + "Vulnerability Introducing Commit": [ + "ca37f8df602a5d65d476a69fbc8ab3177565d538" + ] + } + } + }, + "882d5884f2614944a0c2ae69bafd9d13bfc5b64a": { + "core/src/main/java/io/undertow/server/handlers/resource/URLResource.java": { + "91": { + "Vulnerability Introducing Commit": [ + "ca37f8df602a5d65d476a69fbc8ab3177565d538" + ] + } + } + } + } + } + }, + "vertx-web": { + "CVE-2018-12540": { + "cwe": "CWE-352", + "fixing_commits": { + "98891b1d9e022b467a3e4674aca4d1889849b1d5": { + "vertx-web/src/main/java/io/vertx/ext/web/handler/impl/CSRFHandlerImpl.java": { + "109": { + "Vulnerability Introducing Commit": [ + "85de7938e83ff38205e7f2f0e78fcbc808241554" + ] + }, + "111": { + "Vulnerability Introducing Commit": [ + "85de7938e83ff38205e7f2f0e78fcbc808241554" + ] + }, + "171": { + "Vulnerability Introducing Commit": [ + "85de7938e83ff38205e7f2f0e78fcbc808241554" + ] + } + } + }, + "f42b193b15a29b772fc576b2d0f2497e7474a7e9": { + "vertx-web/src/main/java/io/vertx/ext/web/handler/impl/CSRFHandlerImpl.java": { + "109": { + "Vulnerability Introducing Commit": [ + "85de7938e83ff38205e7f2f0e78fcbc808241554" + ] + }, + "111": { + "Vulnerability Introducing Commit": [ + "85de7938e83ff38205e7f2f0e78fcbc808241554" + ] + }, + "171": { + "Vulnerability Introducing Commit": [ + "85de7938e83ff38205e7f2f0e78fcbc808241554" + ] + } + } + } + } + }, + "CVE-2018-12542": { + "cwe": "CWE-22", + "fixing_commits": { + "57a65dce6f4c5aa5e3ce7288685e7f3447eb8f3b": { + "vertx-web/src/main/java/io/vertx/ext/web/handler/impl/StaticHandlerImpl.java": { + "138": { + "Vulnerability Introducing Commit": [ + "d867369f00c2f4db24798bd023cddc37d4617a54" + ] + } + } + } + } + }, + "CVE-2018-12544": { + "cwe": "CWE-611", + "fixing_commits": { + "ac8692c618d6180a9bc012a2ac8dbec821b1a973": { + "vertx-web-api-contract/src/main/java/io/vertx/ext/web/api/validation/impl/XMLTypeValidator.java": { + "26": { + "Vulnerability Introducing Commit": [ + "92ce562efc3bdc61fb5956309f9a69ca820f6a1e" + ] + }, + "33": { + "Vulnerability Introducing Commit": [ + "92ce562efc3bdc61fb5956309f9a69ca820f6a1e" + ] + }, + "45": { + "Vulnerability Introducing Commit": [ + "92ce562efc3bdc61fb5956309f9a69ca820f6a1e" + ] + }, + "48": { + "Vulnerability Introducing Commit": [ + "92ce562efc3bdc61fb5956309f9a69ca820f6a1e" + ] + } + } + }, + "d814d22ade14bafec47c4447a4ba9bff090f05e8": { + "vertx-web-api-contract/src/main/java/io/vertx/ext/web/api/validation/impl/XMLTypeValidator.java": { + "26": { + "Vulnerability Introducing Commit": [] + }, + "33": { + "Vulnerability Introducing Commit": [] + }, + "45": { + "Vulnerability Introducing Commit": [] + }, + "48": { + "Vulnerability Introducing Commit": [] + } + } + } + } + } + }, + "wildfly-core": { + "CVE-2018-10862": { + "cwe": "CWE-22", + "fixing_commits": { + "40996ae6d5d3b6c1602a15f96b86a8d8a39b53eb": { + "deployment-repository/src/main/java/org/jboss/as/repository/PathUtil.java": { + "150": { + "Vulnerability Introducing Commit": [] + }, + "322": { + "Vulnerability Introducing Commit": [ + "0dcfad067a64c844b70723611a1772078e0afd45" + ] + } + } + } + } + } + }, + "xerces2-j": { + "CVE-2013-4002": { + "cwe": "NVD-CWE-noinfo", + "fixing_commits": { + "266e837852e0f0e3c8c1ad572b6fc4dbb4ded17b": { + "src/org/apache/xerces/impl/XMLScanner.java": { + "545": { + "Vulnerability Introducing Commit": [ + "6fec9ee0c874aba003c6652a39c4de16036f6e4f" + ] + } + } + }, + "628cbc7142ef9acfb61b8e571aab63504235849b": { + "src/org/apache/xerces/impl/XMLScanner.java": { + "545": { + "Vulnerability Introducing Commit": [] + } + } + } + } + } + } + } \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100755 index 0000000..0680c6a --- /dev/null +++ b/dockerfile @@ -0,0 +1,47 @@ +FROM nvidia/cuda:11.8.0-base-ubuntu22.04 + +ENV PYTHON_VERSION=3.9 +ENV DEBIAN_FRONTEND=noninteractive +ENV PATH /opt/conda/bin:$PATH + +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget \ + ca-certificates \ + git \ + && rm -rf /var/lib/apt/lists/* + +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \ + /bin/bash ~/miniconda.sh -b -p /opt/conda && \ + rm ~/miniconda.sh && \ + /opt/conda/bin/conda clean -tipsy && \ + ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ + echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ + echo "conda activate base" >> ~/.bashrc + +RUN conda install -y python=$PYTHON_VERSION && \ + conda clean -tipsy + +WORKDIR /app + +COPY requirements.txt /app/ + +RUN pip install --no-cache-dir -r requirements.txt && \ + pip install --no-cache-dir jupyterlab + +COPY . /app + +RUN useradd -m -s /bin/bash ml-user && \ + chown -R ml-user:ml-user /app + +USER ml-user + +RUN mkdir -p /app/models /app/data /app/output + +ENV PYTHONPATH=/app:$PYTHONPATH +ENV CUDA_VISIBLE_DEVICES=0,1 + +EXPOSE 8888 + +ENTRYPOINT ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"] + +CMD ["python", "main.py"] \ No newline at end of file diff --git a/main.py b/main.py new file mode 100755 index 0000000..f70ed36 --- /dev/null +++ b/main.py @@ -0,0 +1,42 @@ +import os +from src.config import Config +from src.data_loader import DataLoader +from src.model import VulnerabilityDetectionModel +from src.preprocessor import Preprocessor +from src.trainer import Trainer +from src.evaluator import Evaluator +from src.utils import setup_logging, save_results + +def main(): + setup_logging(Config.LOG_FILE) + + data_loader = DataLoader(Config.DATA_PATH) + cve_data = data_loader.get_cve_data() + + model = VulnerabilityDetectionModel(Config.MODEL_NAME, Config.MAX_LENGTH) + preprocessor = Preprocessor(Config.MAX_LENGTH) + + train_size = int(0.8 * len(cve_data)) + train_data = cve_data[:train_size] + test_data = cve_data[train_size:] + + trainer = Trainer(model, preprocessor, Config.DEVICE, Config.LEARNING_RATE) + trainer.train(train_data, Config.NUM_EPOCHS, Config.BATCH_SIZE) + + evaluator = Evaluator(model) + precision, recall, f1 = evaluator.evaluate(test_data) + + results = { + "precision": precision, + "recall": recall, + "f1_score": f1 + } + + save_results(Config.OUTPUT_DIR, results) + + print(f"Precision: {precision:.4f}") + print(f"Recall: {recall:.4f}") + print(f"F1 Score: {f1:.4f}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100755 index 0000000..372ff5f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +vllm==0.2.0 +torch==2.0.1 +transformers==4.30.2 +scikit-learn==1.2.2 +tqdm==4.65.0 +numpy==1.24.3 +pandas==2.0.2 \ No newline at end of file diff --git a/src/__init__.py b/src/__init__.py new file mode 100755 index 0000000..f3c8bea --- /dev/null +++ b/src/__init__.py @@ -0,0 +1,7 @@ +from .config import Config +from .data_loader import DataLoader +from .model import VulnerabilityDetectionModel +from .preprocessor import Preprocessor +from .trainer import Trainer +from .evaluator import Evaluator +from .utils import setup_logging, save_results \ No newline at end of file diff --git a/src/config.py b/src/config.py new file mode 100755 index 0000000..31c11ff --- /dev/null +++ b/src/config.py @@ -0,0 +1,12 @@ +import os + +class Config: + DATA_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data', 'dataset.json') + MODEL_NAME = "meta-llama/Llama-3.1-8B-Instruct" + MAX_LENGTH = 512 + BATCH_SIZE = 16 + LEARNING_RATE = 2e-5 + NUM_EPOCHS = 5 + DEVICE = "cuda" + OUTPUT_DIR = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'output') + LOG_FILE = os.path.join(OUTPUT_DIR, 'training.log') \ No newline at end of file diff --git a/src/data_loader.py b/src/data_loader.py new file mode 100755 index 0000000..a2d3f6c --- /dev/null +++ b/src/data_loader.py @@ -0,0 +1,23 @@ +import json +from typing import Dict, List, Tuple + +class DataLoader: + def __init__(self, file_path: str): + self.file_path = file_path + self.data = self._load_data() + + def _load_data(self) -> Dict: + with open(self.file_path, 'r') as f: + return json.load(f) + + def get_cve_data(self) -> List[Tuple[str, str, str, str, List[str]]]: + cve_data = [] + for project, cves in self.data.items(): + for cve_id, cve_info in cves.items(): + cwe = cve_info.get('cwe', '') + for fixing_commit, files in cve_info.get('fixing_commits', {}).items(): + for file_path, lines in files.items(): + for line_num, line_info in lines.items(): + introducing_commits = line_info.get('Vulnerability Introducing Commit', []) + cve_data.append((project, cve_id, cwe, fixing_commit, introducing_commits)) + return cve_data \ No newline at end of file diff --git a/src/evaluator.py b/src/evaluator.py new file mode 100755 index 0000000..e003d82 --- /dev/null +++ b/src/evaluator.py @@ -0,0 +1,22 @@ +from .model import VulnerabilityDetectionModel +from typing import List, Tuple +from sklearn.metrics import precision_score, recall_score, f1_score + +class Evaluator: + def __init__(self, model: VulnerabilityDetectionModel): + self.model = model + + def evaluate(self, test_data: List[Tuple[str, str, str, str, List[str]]]) -> Tuple[float, float, float]: + prompts = [self.model.format_prompt(project, cve_id, cwe, fixing_commit) for project, cve_id, cwe, fixing_commit, _ in test_data] + true_labels = [introducing_commits for _, _, _, _, introducing_commits in test_data] + + predicted_labels = self.model.predict(prompts) + + flattened_true = [commit for commits in true_labels for commit in commits] + flattened_pred = [commit for commits in predicted_labels for commit in commits.split()] + + precision = precision_score(flattened_true, flattened_pred, average='micro') + recall = recall_score(flattened_true, flattened_pred, average='micro') + f1 = f1_score(flattened_true, flattened_pred, average='micro') + + return precision, recall, f1 \ No newline at end of file diff --git a/src/model.py b/src/model.py new file mode 100755 index 0000000..40ac734 --- /dev/null +++ b/src/model.py @@ -0,0 +1,14 @@ +from vllm import LLM, SamplingParams +from typing import List + +class VulnerabilityDetectionModel: + def __init__(self, model_name: str, max_length: int): + self.model = LLM(model=model_name) + self.sampling_params = SamplingParams(temperature=0.7, top_p=0.95, max_tokens=max_length) + + def predict(self, prompts: List[str]) -> List[str]: + outputs = self.model.generate(prompts, self.sampling_params) + return [output.outputs[0].text for output in outputs] + + def format_prompt(self, project: str, cve_id: str, cwe: str, fixing_commit: str) -> str: + return f"Project: {project}\nCVE ID: {cve_id}\nCWE: {cwe}\nFixing Commit: {fixing_commit}\nIdentify the vulnerability introducing commit:" \ No newline at end of file diff --git a/src/preprocessor.py b/src/preprocessor.py new file mode 100755 index 0000000..218cac5 --- /dev/null +++ b/src/preprocessor.py @@ -0,0 +1,14 @@ +from typing import List, Tuple + +class Preprocessor: + def __init__(self, max_length: int): + self.max_length = max_length + + def prepare_data(self, cve_data: List[Tuple[str, str, str, str, List[str]]]) -> Tuple[List[str], List[List[str]]]: + prompts = [] + labels = [] + for project, cve_id, cwe, fixing_commit, introducing_commits in cve_data: + prompt = f"Project: {project}\nCVE ID: {cve_id}\nCWE: {cwe}\nFixing Commit: {fixing_commit}\nIdentify the vulnerability introducing commit:" + prompts.append(prompt[:self.max_length]) + labels.append(introducing_commits) + return prompts, labels \ No newline at end of file diff --git a/src/trainer.py b/src/trainer.py new file mode 100755 index 0000000..178c454 --- /dev/null +++ b/src/trainer.py @@ -0,0 +1,43 @@ +from .model import VulnerabilityDetectionModel +from .preprocessor import Preprocessor +from typing import List, Tuple +import torch +from torch.utils.data import DataLoader, TensorDataset +from tqdm import tqdm + +class Trainer: + def __init__(self, model: VulnerabilityDetectionModel, preprocessor: Preprocessor, device: str, learning_rate: float): + self.model = model + self.preprocessor = preprocessor + self.device = device + self.learning_rate = learning_rate + + def train(self, cve_data: List[Tuple[str, str, str, str, List[str]]], num_epochs: int, batch_size: int): + prompts, labels = self.preprocessor.prepare_data(cve_data) + dataset = TensorDataset(torch.tensor(prompts), torch.tensor(labels)) + dataloader = DataLoader(dataset, batch_size=batch_size, shuffle=True) + + optimizer = torch.optim.AdamW(self.model.parameters(), lr=self.learning_rate) + + for epoch in range(num_epochs): + self.model.train() + total_loss = 0 + for batch in tqdm(dataloader, desc=f"Epoch {epoch+1}/{num_epochs}"): + inputs, targets = batch + inputs = inputs.to(self.device) + targets = targets.to(self.device) + + outputs = self.model(inputs) + loss = self.compute_loss(outputs, targets) + + optimizer.zero_grad() + loss.backward() + optimizer.step() + + total_loss += loss.item() + + avg_loss = total_loss / len(dataloader) + print(f"Epoch {epoch+1}/{num_epochs}, Average Loss: {avg_loss:.4f}") + + def compute_loss(self, outputs, targets): + return torch.nn.functional.cross_entropy(outputs, targets) \ No newline at end of file diff --git a/src/utils.py b/src/utils.py new file mode 100755 index 0000000..deefa48 --- /dev/null +++ b/src/utils.py @@ -0,0 +1,19 @@ +import logging +import os +import json + +def setup_logging(log_file: str): + logging.basicConfig( + level=logging.INFO, + format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', + handlers=[ + logging.FileHandler(log_file), + logging.StreamHandler() + ] + ) + +def save_results(output_dir: str, results: dict): + os.makedirs(output_dir, exist_ok=True) + output_file = os.path.join(output_dir, 'results.json') + with open(output_file, 'w') as f: + json.dump(results, f, indent=2) \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100755 index 0000000..f038dae --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,3 @@ +from .test_data_loader import TestDataLoader +from .test_model import TestVulnerabilityDetectionModel +from .test_preprocessor import TestPreprocessor \ No newline at end of file diff --git a/tests/test_data_loader.py b/tests/test_data_loader.py new file mode 100755 index 0000000..7026019 --- /dev/null +++ b/tests/test_data_loader.py @@ -0,0 +1,44 @@ +import unittest +import os +import json +from src.data_loader import DataLoader + +class TestDataLoader(unittest.TestCase): + def setUp(self): + self.test_data = { + "test_project": { + "CVE-2021-1234": { + "cwe": "CWE-79", + "fixing_commits": { + "abcdef1234567890": { + "path/to/file.py": { + "42": { + "Vulnerability Introducing Commit": [ + "1234567890abcdef" + ] + } + } + } + } + } + } + } + self.test_file = "test_dataset.json" + with open(self.test_file, "w") as f: + json.dump(self.test_data, f) + self.data_loader = DataLoader(self.test_file) + + def tearDown(self): + os.remove(self.test_file) + + def test_load_data(self): + self.assertEqual(self.data_loader.data, self.test_data) + + def test_get_cve_data(self): + expected_output = [ + ("test_project", "CVE-2021-1234", "CWE-79", "abcdef1234567890", ["1234567890abcdef"]) + ] + self.assertEqual(self.data_loader.get_cve_data(), expected_output) + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/tests/test_model.py b/tests/test_model.py new file mode 100755 index 0000000..50954cf --- /dev/null +++ b/tests/test_model.py @@ -0,0 +1,33 @@ +import unittest +from unittest.mock import Mock, patch +from src.model import VulnerabilityDetectionModel + +class TestVulnerabilityDetectionModel(unittest.TestCase): + def setUp(self): + self.model = VulnerabilityDetectionModel("test_model", 512) + + @patch('src.model.LLM') + def test_predict(self, mock_llm): + mock_output = Mock() + mock_output.outputs = [Mock(text="Predicted output")] + mock_llm.return_value.generate.return_value = [mock_output] + + prompts = ["Test prompt"] + result = self.model.predict(prompts) + + self.assertEqual(result, ["Predicted output"]) + mock_llm.return_value.generate.assert_called_once_with(prompts, self.model.sampling_params) + + def test_format_prompt(self): + project = "test_project" + cve_id = "CVE-2021-1234" + cwe = "CWE-79" + fixing_commit = "abcdef1234567890" + + expected_prompt = f"Project: {project}\nCVE ID: {cve_id}\nCWE: {cwe}\nFixing Commit: {fixing_commit}\nIdentify the vulnerability introducing commit:" + result = self.model.format_prompt(project, cve_id, cwe, fixing_commit) + + self.assertEqual(result, expected_prompt) + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/tests/test_preprocessor.py b/tests/test_preprocessor.py new file mode 100755 index 0000000..f210f57 --- /dev/null +++ b/tests/test_preprocessor.py @@ -0,0 +1,34 @@ +import unittest +from src.preprocessor import Preprocessor + +class TestPreprocessor(unittest.TestCase): + def setUp(self): + self.preprocessor = Preprocessor(max_length=100) + + def test_prepare_data(self): + cve_data = [ + ("project1", "CVE-2021-1234", "CWE-79", "fix1", ["intro1"]), + ("project2", "CVE-2021-5678", "CWE-89", "fix2", ["intro2", "intro3"]) + ] + + prompts, labels = self.preprocessor.prepare_data(cve_data) + + expected_prompts = [ + "Project: project1\nCVE ID: CVE-2021-1234\nCWE: CWE-79\nFixing Commit: fix1\nIdentify the vulnerability introducing commit:", + "Project: project2\nCVE ID: CVE-2021-5678\nCWE: CWE-89\nFixing Commit: fix2\nIdentify the vulnerability introducing commit:" + ] + expected_labels = [["intro1"], ["intro2", "intro3"]] + + self.assertEqual(prompts, expected_prompts) + self.assertEqual(labels, expected_labels) + + def test_max_length_truncation(self): + self.preprocessor.max_length = 50 + cve_data = [("very_long_project_name", "CVE-2021-1234", "CWE-79", "very_long_fixing_commit_hash", ["intro1"])] + + prompts, _ = self.preprocessor.prepare_data(cve_data) + + self.assertEqual(len(prompts[0]), 50) + +if __name__ == '__main__': + unittest.main() \ No newline at end of file