[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-chris-koch-penn--gpt3_security_vulnerability_scanner":3,"tool-chris-koch-penn--gpt3_security_vulnerability_scanner":64},[4,17,27,35,48,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",142651,2,"2026-04-06T23:34:12",[13,14,15],"开发框架","Agent","语言模型","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,3,"2026-04-06T11:19:32",[15,26,14,13],"图像",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":10,"last_commit_at":33,"category_tags":34,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":10,"last_commit_at":41,"category_tags":42,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",85013,"2026-04-06T11:09:19",[26,43,44,45,14,46,15,13,47],"数据工具","视频","插件","其他","音频",{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":23,"last_commit_at":54,"category_tags":55,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[14,26,13,15,46],{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":23,"last_commit_at":62,"category_tags":63,"status":16},519,"PaddleOCR","PaddlePaddle\u002FPaddleOCR","PaddleOCR 是一款基于百度飞桨框架开发的高性能开源光学字符识别工具包。它的核心能力是将图片、PDF 等文档中的文字提取出来，转换成计算机可读取的结构化数据，让机器真正“看懂”图文内容。\n\n面对海量纸质或电子文档，PaddleOCR 解决了人工录入效率低、数字化成本高的问题。尤其在人工智能领域，它扮演着连接图像与大型语言模型（LLM）的桥梁角色，能将视觉信息直接转化为文本输入，助力智能问答、文档分析等应用场景落地。\n\nPaddleOCR 适合开发者、算法研究人员以及有文档自动化需求的普通用户。其技术优势十分明显：不仅支持全球 100 多种语言的识别，还能在 Windows、Linux、macOS 等多个系统上运行，并灵活适配 CPU、GPU、NPU 等各类硬件。作为一个轻量级且社区活跃的开源项目，PaddleOCR 既能满足快速集成的需求，也能支撑前沿的视觉语言研究，是处理文字识别任务的理想选择。",74991,"2026-04-06T23:16:49",[15,26,13,46],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":77,"owner_avatar_url":78,"owner_bio":79,"owner_company":79,"owner_location":79,"owner_email":79,"owner_twitter":79,"owner_website":79,"owner_url":80,"languages":81,"stars":122,"forks":123,"last_commit_at":124,"license":79,"difficulty_score":10,"env_os":125,"env_gpu":126,"env_ram":126,"env_deps":127,"category_tags":130,"github_topics":79,"view_count":10,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":131,"updated_at":132,"faqs":133,"releases":134},4870,"chris-koch-penn\u002Fgpt3_security_vulnerability_scanner","gpt3_security_vulnerability_scanner","GPT-3 found hundreds of security vulnerabilities in this repo","gpt3_security_vulnerability_scanner 是一项利用 OpenAI GPT-3 大模型进行代码安全分析的实验性工具，旨在自动识别源代码中的潜在安全漏洞。在传统静态分析工具往往受限于规则匹配而漏报较多的背景下，该工具通过大语言模型的语义理解能力，有效解决了复杂逻辑下漏洞难以发现的问题。实验数据显示，它在特定测试集中发现了 213 个安全问题，数量远超某知名商业扫描工具的 99 个，且人工复核显示其误报率极低。\n\n这款工具特别适合软件开发人员、安全研究人员以及对 AI 赋能代码审计感兴趣的技术团队使用。开发者可将其作为现有安全流程的补充，快速筛查代码片段；研究人员则能借此探索大模型在网络安全领域的应用边界。\n\n其核心技术亮点在于巧妙克服了 GPT-3 上下文窗口的限制，采用分文件扫描策略。更令人印象深刻的是，凭借训练数据中对常见开发库（如 Express.js、Flask 及标准库）的深厚“记忆”，即使不查看依赖库的具体源码，它也能准确推断函数行为并识别跨文件交互引发的安全隐患。虽然目前尚无法一次性处理整个大型仓库，但其展现出的智能分析潜力，为未来的自动化代码","gpt3_security_vulnerability_scanner 是一项利用 OpenAI GPT-3 大模型进行代码安全分析的实验性工具，旨在自动识别源代码中的潜在安全漏洞。在传统静态分析工具往往受限于规则匹配而漏报较多的背景下，该工具通过大语言模型的语义理解能力，有效解决了复杂逻辑下漏洞难以发现的问题。实验数据显示，它在特定测试集中发现了 213 个安全问题，数量远超某知名商业扫描工具的 99 个，且人工复核显示其误报率极低。\n\n这款工具特别适合软件开发人员、安全研究人员以及对 AI 赋能代码审计感兴趣的技术团队使用。开发者可将其作为现有安全流程的补充，快速筛查代码片段；研究人员则能借此探索大模型在网络安全领域的应用边界。\n\n其核心技术亮点在于巧妙克服了 GPT-3 上下文窗口的限制，采用分文件扫描策略。更令人印象深刻的是，凭借训练数据中对常见开发库（如 Express.js、Flask 及标准库）的深厚“记忆”，即使不查看依赖库的具体源码，它也能准确推断函数行为并识别跨文件交互引发的安全隐患。虽然目前尚无法一次性处理整个大型仓库，但其展现出的智能分析潜力，为未来的自动化代码审计提供了新的思路。","# Experimenting with GPT-3 for Detecting Security Vulnerabilities in Code\n**Summary**: GPT-3 found 213 security vulnerabilities in this [git repository](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner). In comparison, one of the better commercial tools on the market (from a reputable cybersecurity company) only found 99 issues, although their tool provides context in a more structured format. After manually reviewing a random sample of 60 \u002F 213 of the vulnerabilities detected by GPT-3, only 4 were false positives. Both tools had many false negatives.\nThe full text of this README is available as a Medium article [here](https:\u002F\u002Fbetterprogramming.pub\u002Fi-used-gpt-3-to-find-213-security-vulnerabilities-in-a-single-codebase-cc3870ba9411).\n\n## Introduction\nIn recent years, the field of artificial intelligence and machine learning has seen tremendous growth and has opened up a new realm of possibilities. One such field that has been gaining attention is AI-based code analysis, specifically the use of AI models to detect security vulnerabilities in code. In this experiment, we used OpenAI's GPT-3 to find security vulnerabilities in a [code repository](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner) containing 129 vulnerable files.\n\n## How it Works\nThe variant of GPT-3 I used (text-davinci-003) has a context window of 4000 tokens, which is roughly 3000 english words. This means it can process at most a few hundred lines of code per request. Unfortunately, GPT-3’s current architecture can’t handle a whole repo at once.\n\nTo get around this, I had to scan all of the files with GPT-3 separately. This means GPT-3 might have trouble finding security vulnerabilities that are the result of multiple files of code interacting, unless the import\u002Fexports are clear enough to make a guess as to what those functions do without needing to specifically see the code. This ended up often being the case, particularly when the source code was using common libraries like express.js, Flask, the Python standard library, the C standard library, etc. It’s likely that GPT-3 has many of the most common libraries either partially memorized, fully memorized, or encoded in some other way. In the case of the code analyzed in this article, GPT-3 had enough prior knowledge about the imported libraries that it was able to accurately detect security vulnerabilities without needing to inspect any of the imported library code.\n\nTo be fair to GPT-3, I suspect that many of the existing commercial vulnerability scanners don’t actually inspect imported library code when doing static analysis — so this is not that different from how some of the tools on the market already work.\n\n### The code that was analyzed\nEach folder in the repository is named after a type of security vulnerability and contains files with example code containing one or more vulnerabilities. Some of these files contain trivial code, but many are fairly realistic code snippets you might come across in a production code base (note: they are still snippets though, and therefore lack the context of a larger codebase). The README.md file in each folder of the repository contains GPT-3’s analysis of the security vulnerabilities for all of the files in that folder.\n\nLet’s take a look at some examples to see how GPT-3 did!\n\n### Example 1 (trivial)\nHere is a [simple C program](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner\u002Fblob\u002Fmain\u002FFormat%20String%20Attacks\u002FFormatString.c) that is vulnerable to a Format String Attack:\n\n```c\n#include \u003Cstdio.h>\n \nint main(int argc, char **argv) {\n    printf(argv[1]);\n \n    return 0;\n}\n```\n\nAnd here is GPT-3's analyis (which is correct):\n```md\nVulnerabilities Detected:\n1. Unvalidated user input: The program does not check the length of the user input, which could lead to a buffer overflow attack.\n2. Format string vulnerability: The program does not check the format of the user input, which could lead to a format string attack.\n```\n\n### Example 2 (less trivial)\nLet's try this with a less trivial program in a higher level language, like this [C# program](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner\u002Fblob\u002Fmain\u002FLog%20Forging\u002Flogf.cs) containing a Log Forging vulnerability. I've personally seen similar (although less trivial) code in open-source projects and production code bases:\n\n```csharp\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.Extensions.Logging;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace WebFox.Controllers\n{\n    [Route(\"api\u002F[controller]\")]\n    [ApiController]\n    public class LogInjection : ControllerBase\n    {\n        private readonly ILogger\u003CLogInjection> _logger;\n\n\n        public LogInjection(ILogger\u003CLogInjection> logger)\n        {\n            _logger = logger;\n        }\n\n        [HttpGet(\"{userInfo}\")]\n        public void injectLog(string userInfo)\n        {\n            _logger.LogError(\"error!! \" + userInfo);\n        }\n    }\n}\n```\n\nGPT-3's output:\n```md\nVulnerabilities Detected:\n1. Log injection vulnerability: The code is vulnerable to log injection attacks as user input is being directly logged without any sanitization.\n```\nGPT-3's evaluation is correct - there is a log injection vulnerability in this code.\n\n### Example 3 (non-trivial)\nThe following [C program](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner\u002Fblob\u002Fmain\u002FOut%20of%20Bounds\u002Fvuln.c) reads and manipulates an image. It contains numerous security vulnerabilities, including Out Of Bounds reads and writes:\n\n```c\n#include\u003Cstdio.h>\n#include\u003Cstdlib.h>\n#include\u003Cstring.h>\n\nstruct Image\n{\n    char header[4];\n    int width;\n    int height;\n    char data[10];\n};\n\nint ProcessImage(char* filename){\n\n    FILE *fp;\n    char ch;\n    struct Image img;\n\n    fp = fopen(filename,\"r\"); \n\n    if(fp == NULL)\n    {\n        printf(\"\\nCan't open file or file doesn't exist.\");\n        exit(0);\n    }\n\n    printf(\"\\n\\tHeader\\twidth\\theight\\tdata\\t\\r\\n\");\n\n    while(fread(&img,sizeof(img),1,fp)>0){\n        printf(\"\\n\\t%s\\t%d\\t%d\\t%s\\r\\n\",img.header,img.width,img.height,img.data);\n    \n        int size1 = img.width + img.height;\n        char* buff1=(char*)malloc(size1);\n\n        memcpy(buff1,img.data,sizeof(img.data));\n        free(buff1);\n    \n        if (size1\u002F2==0){\n            free(buff1);\n        }\n        else{\n            if(size1 == 123456){\n                buff1[0]='a';\n            }\n        }\n\n        int size2 = img.width - img.height+100;\n        \u002F\u002Fprintf(\"Size1:%d\",size1);\n        char* buff2=(char*)malloc(size2);\n\n        memcpy(buff2,img.data,sizeof(img.data));\n\n        int size3= img.width\u002Fimg.height;\n        \u002F\u002Fprintf(\"Size2:%d\",size3);\n\n        char buff3[10];\n        char* buff4 =(char*)malloc(size3);\n        memcpy(buff4,img.data,sizeof(img.data));\n\n        char OOBR_stack = buff3[size3+100];\n        char OOBR_heap = buff4[100];\n\n        buff3[size3+100]='c';\n        buff4[100]='c';\n\n        if(size3>10){\n                buff4=0;\n        }\n        else{\n            free(buff4);\n        }\n\n        free(buff2);\n    }\n    fclose(fp);\n}\n\nint main(int argc,char **argv)\n{\n    ProcessImage(argv[1]);\n}\n```\n\nGPT-3's output:\n```md\nVulnerabilities Detected:\n1. Unchecked return value: The return value of the fopen() function is not checked, which could lead to a null pointer dereference.\n2. Out-of-bounds read: The memcpy() function is used to copy data from img.data to buff1 and buff2 without checking the size of the destination buffer, which could lead to an out-of-bounds read.\n3. Out-of-bounds write: The buff3 and buff4 arrays are written to without checking the size of the source buffer, which could lead to an out-of-bounds write.\n4. Uninitialized memory access: The OOBR_stack and OOBR_heap variables are accessed without being initialized, which could lead to undefined behavior.\n5. Memory leak: The buff4 array is not freed if the size3 variable is greater than 10, which could lead to a memory leak.\n```\nGPT-3 is correct for 4 out of 5 of these. Vulnerability 1 is a false positive as the value of fopen() is checked in the line if(fp == NULL). Also, vulnerability 4 is worded in a way that is misleading - it is correct that there are two uninitialized memory access bugs on the lines of code that it is referencing, but it mentions the wrong variable names.\n\n### Example 4\nThis last [Java example](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner\u002Fblob\u002Fmain\u002FUnsafe%20Deserialization\u002FSerializeToFile.java) is my favorite because, unfortunately, I didn't see anything wrong with this code when I first read it. To me, it looked completely innocuous and *familiar* - I've seen similar code in the wild but never had any second thoughts.\n\n```java\nclass Utils\n{\n    \u002F\u002F Function to serialize an object and write it to a file\n    public static void SerializeToFile(Object obj, String filename)\n    {\n        try\n        {\n            FileOutputStream file = new FileOutputStream(filename);\n            ObjectOutputStream out = new ObjectOutputStream(file);\n\n            \u002F\u002F Serialization of the object to file\n            System.out.println(\"Serializing \" + obj.toString() + \" to \" + filename);\n            out.writeObject(obj);\n\n            out.close();\n            file.close();\n        }\n        catch(Exception e)\n        {\n            System.out.println(\"Exception: \" + e.toString());\n        }\n    }\n\n    \u002F\u002F Function to deserialize an object from a file\n    public static Object DeserializeFromFile(String filename)\n    {\n        Object obj = new Object();\n\n        try\n        {\n            FileInputStream file = new FileInputStream(filename);\n            ObjectInputStream in = new ObjectInputStream(file);\n\n            \u002F\u002F Deserialization of the object to file\n            System.out.println(\"Deserializing from \" + filename);\n            obj = in.readObject();\n\n            in.close();\n            file.close();\n        }\n        catch(Exception e)\n        {\n            System.out.println(\"Exception: \" + e.toString());\n        }\n\n        return obj;\n    }\n}\n```\n\nGPT-3's output:\n```md\nVulnerabilities Detected:\n1. Insecure Deserialization: Deserializing untrusted data can lead to remote code execution.\n2. Insecure File Permissions: The file being written to or read from may have insecure permissions, allowing unauthorized access.\n```\n\nGPT-3 is correct again.\n\n### The Ultimate \"Shift-left\" in Cybersecurity\nShifting-left is the process of applying security practices earlier in the development process - like testing for security bugs before deploying your code to production.\n\nAI code-analysis could represent the ultimate shift-left in cybersecurity by applying best security practices and educating developers on cybersecurity as they are *writing and committing code*. This could truly foster a culture of strong cybersecurity inside an organization and even prevent the next big hack, but... \n\nAdmittedly, the technology is not perfect yet and there are several things it missed that an experienced cybersecurity professional doing an audit would not have missed. Still, it's shockingly good for being a general-purpose large language model and it's far cheaper than the alternatives.\n\nGPT-4 doesn't currently have a release date, but I'm sure these large language models will continue to march forward as they gain more and more capabilities. \n\n### The False Positive\nAfter manually reviewing around 60 out of 213 of the vulnerabilities detected by GPT-3, one of the false positives I found that was notable was on line 13 of this [Javascript program](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner\u002Fblob\u002Fmain\u002FUnsafe%20Deserialization\u002Funsafe.js):\n```js\nvar express = require('express');\nvar cookieParser = require('cookie-parser');\nvar escape = require('escape-html');\nvar serialize = require('node-serialize');\nvar app = express();\napp.use(cookieParser())\n \napp.get('\u002F', function(req, res) {\n if (req.cookies.profile) {\n   var str = new Buffer(req.cookies.profile, 'base64').toString();\n   var obj = serialize.unserialize(str);\n   if (obj.username) {\n     res.send(\"Hello \" + escape(obj.username)); \u002F\u002F \u003C--- GPT-3 makes a mistake here\n   }\n } else {\n     res.cookie('profile', \"eyJ1c2VybmFtZSI6ImFqaW4iLCJjb3VudHJ5IjoiaW5kaWEiLCJjaXR5IjoiYmFuZ2Fsb3JlIn0=\", {\n       maxAge: 900000,\n       httpOnly: true\n     });\n }\n res.send(\"Hello World\");\n});\napp.listen(3000);\n```\nGPT-3's output:\n```md\nVulnerabilities Detected:\n- Insecure cookie settings (no secure flag set)\n- Unvalidated deserialization of user input (cookie)\n- Potential XSS vulnerability due to lack of escaping of user input (username)\n```\nGPT-3 is correct about the first two vulnerabilities, but the third vulnerability is a false positive - `obj.username` is escaped, but GPT-3 is saying that it is not.\n\n## Results\nThe results of the experiment showed that GPT-3 was able to detect security vulnerabilities in 85 out of 129 files scanned. This is quite impressive!\n\nThe script [`summarize_results.py`](summarize_results.py) generates a summary of GPT-3's results:\n```\nVulnerabilities detected in 86 \u002F 129 files.\nDetected 213 vulnerabilities in total.\n\nFrequency of introductory sentences used in GPT-3's responses (1 response \u002F file scanned):\n{'vulnerabilities detected': 73, 'no vulnerabilities detected.': 43, 'vulnerability detected': 6, 'answer': 2, 'potential vulnerabilities detected': 2, 'analysis': 1, 'security vulnerabilities detected': 1, 'no response given': 1} \n\nDistribution of file types scanned: \n129 files of code in total (excluding markdown and flatfiles)\n{'.php': 50, '.js': 20, '.cs': 16, '.c': 14, '.java': 9, '.py': 8, '.rb': 5, '.asp': 3, '.ts': 2, '.go': 1, '.html': 1}\n```\n\n### Comparison to Commercial Offerings\nTo round out this experiment, I compared the results of GPT-3 with a commercially available code vulnerability scanner, [Snyk Code](https:\u002F\u002Fsnyk.io\u002Fproduct\u002Fsnyk-code\u002F), which is made by Snyk - a company which I think makes excellent security products. After running this repo through Snyk Code, it found 99 security vulnerabilities compared to the 213 found by GPT-3. \n\n![Snyk's results](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fchris-koch-penn_gpt3_security_vulnerability_scanner_readme_4791196468b3.png)\n\nOne contributing factor is that Snyk Code only supports certain programming languages, and was only able to scan around 103 files compared to the 129 files scanned by GPT-3.\n\n### Final Notes\nIf you're interested in seeing this experiment become a full product, express interest through this super short [Google Form](https:\u002F\u002Fforms.gle\u002FmXy8NVZb5fshqCAt6).\n\nThe vulnerable code snippets in this repo were taken from [snoopysecurity\u002FVulnerable-Code-Snippets](https:\u002F\u002Fgithub.com\u002Fsnoopysecurity\u002FVulnerable-Code-Snippets), which is a fantastic resource. I tried to remove any comments embedded in the code snippets that hinted at what security vulnerabilities were contained in that snippet. This required me to remove comments containing links to blog posts and articles that these example snippets were gathered from. Any attributions present in the original repo can be found in the [attributions.md](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner\u002Fblob\u002Fmain\u002Fattributions.md) file.\n","# 使用 GPT-3 检测代码中的安全漏洞实验\n**摘要**：GPT-3 在这个 [Git 仓库](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner) 中发现了 213 个安全漏洞。相比之下，市场上一款较优秀的商业工具（来自一家信誉良好的网络安全公司）仅检测出 99 个问题，不过该工具以更结构化的格式提供了上下文信息。在手动审查了 GPT-3 检测到的 213 个漏洞中随机抽取的 60 个样本后，仅有 4 个属于误报。两款工具都存在大量漏报。\n\n本 README 的全文已作为 Medium 文章发布，[点击此处](https:\u002F\u002Fbetterprogramming.pub\u002Fi-used-gpt-3-to-find-213-security-vulnerabilities-in-a-single-codebase-cc3870ba9411) 查看。\n\n## 引言\n近年来，人工智能和机器学习领域取得了迅猛发展，开辟了全新的可能性。其中一个备受关注的方向是基于 AI 的代码分析，尤其是利用 AI 模型来检测代码中的安全漏洞。在本次实验中，我们使用了 OpenAI 的 GPT-3 来查找一个包含 129 个易受攻击文件的 [代码仓库](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner) 中的安全漏洞。\n\n## 工作原理\n我使用的 GPT-3 变体（text-davinci-003）具有 4000 个 token 的上下文窗口，大约相当于 3000 个英文单词。这意味着每次请求最多只能处理几百行代码。遗憾的是，GPT-3 当前的架构无法一次性处理整个代码库。\n\n为了解决这个问题，我不得不单独用 GPT-3 扫描每个文件。这就意味着，对于那些需要多文件交互才能暴露的安全漏洞，GPT-3 可能难以发现，除非导入或导出语句足够清晰，能够仅凭这些信息就推测出相关函数的功能，而无需直接查看具体代码。这种情况经常发生，尤其是在源代码使用了诸如 express.js、Flask、Python 标准库、C 标准库等常见库时。很可能 GPT-3 对许多常用库已经部分记忆、完全记忆，或者以其他方式进行了编码。在本文所分析的代码中，GPT-3 对导入的库已有足够的先验知识，因此能够在不检查任何被导入库代码的情况下准确检测出安全漏洞。\n\n公平地说，我怀疑许多现有的商业漏洞扫描工具在进行静态分析时也并不会检查被导入的库代码——因此，GPT-3 的工作方式与市面上某些工具并无本质区别。\n\n### 被分析的代码\n该仓库中的每个文件夹都以一种特定类型的安全漏洞命名，并包含带有单个或多个漏洞的示例代码文件。其中一些文件非常简单，但许多都是你在生产环境中可能遇到的真实代码片段（需要注意的是，它们仍然是代码片段，因此缺乏更大代码库的上下文）。每个文件夹中的 README.md 文件包含了 GPT-3 对该文件夹内所有文件中安全漏洞的分析结果。\n\n让我们通过几个例子来看看 GPT-3 的表现吧！\n\n### 示例 1（简单）\n以下是一个易受格式化字符串攻击的 [简单的 C 程序](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner\u002Fblob\u002Fmain\u002FFormat%20String%20Attacks\u002FFormatString.c)：\n\n```c\n#include \u003Cstdio.h>\n \nint main(int argc, char **argv) {\n    printf(argv[1]);\n \n    return 0;\n}\n```\n\n以下是 GPT-3 的分析结果（正确）：\n```md\n检测到的漏洞：\n1. 未验证的用户输入：程序未检查用户输入的长度，可能导致缓冲区溢出攻击。\n2. 格式化字符串漏洞：程序未对用户输入的格式进行检查，可能导致格式化字符串攻击。\n```\n\n### 示例 2（稍复杂）\n接下来我们来看一个更高层次语言编写的稍复杂的程序，比如这个包含日志伪造漏洞的 [C# 程序](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner\u002Fblob\u002Fmain\u002FLog%20Forging\u002Flogf.cs)。我个人曾在开源项目和生产代码库中见过类似的代码（虽然没有这么复杂）：\n\n```csharp\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.Extensions.Logging;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\n\nnamespace WebFox.Controllers\n{\n    [Route(\"api\u002F[controller]\")]\n    [ApiController]\n    public class LogInjection : ControllerBase\n    {\n        private readonly ILogger\u003CLogInjection> _logger;\n\n\n        public LogInjection(ILogger\u003CLogInjection> logger)\n        {\n            _logger = logger;\n        }\n\n        [HttpGet(\"{userInfo}\")]\n        public void injectLog(string userInfo)\n        {\n            _logger.LogError(\"error!! \" + userInfo);\n        }\n    }\n}\n```\n\nGPT-3 的输出如下：\n```md\n检测到的漏洞：\n1. 日志注入漏洞：代码存在日志注入漏洞，因为用户输入未经任何清理就被直接记录下来。\n```\n\nGPT-3 的评估是正确的——这段代码确实存在日志注入漏洞。\n\n### 示例 3（非平凡）\n以下是一个[C程序](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner\u002Fblob\u002Fmain\u002FOut%20of%20Bounds\u002Fvuln.c)，用于读取和操作图像。该程序包含大量安全漏洞，包括越界读取和写入：\n\n```c\n#include\u003Cstdio.h>\n#include\u003Cstdlib.h>\n#include\u003Cstring.h>\n\nstruct Image\n{\n    char header[4];\n    int width;\n    int height;\n    char data[10];\n};\n\nint ProcessImage(char* filename){\n\n    FILE *fp;\n    char ch;\n    struct Image img;\n\n    fp = fopen(filename,\"r\"); \n\n    if(fp == NULL)\n    {\n        printf(\"\\n无法打开文件或文件不存在。\");\n        exit(0);\n    }\n\n    printf(\"\\n\\tHeader\\twidth\\theight\\tdata\\t\\r\\n\");\n\n    while(fread(&img,sizeof(img),1,fp)>0){\n        printf(\"\\n\\t%s\\t%d\\t%d\\t%s\\r\\n\",img.header,img.width,img.height,img.data);\n    \n        int size1 = img.width + img.height;\n        char* buff1=(char*)malloc(size1);\n\n        memcpy(buff1,img.data,sizeof(img.data));\n        free(buff1);\n    \n        if (size1\u002F2==0){\n            free(buff1);\n        }\n        else{\n            if(size1 == 123456){\n                buff1[0]='a';\n            }\n        }\n\n        int size2 = img.width - img.height+100;\n        \u002F\u002Fprintf(\"Size1:%d\",size1);\n        char* buff2=(char*)malloc(size2);\n\n        memcpy(buff2,img.data,sizeof(img.data));\n\n        int size3= img.width\u002Fimg.height;\n        \u002F\u002Fprintf(\"Size2:%d\",size3);\n\n        char buff3[10];\n        char* buff4 =(char*)malloc(size3);\n        memcpy(buff4,img.data,sizeof(img.data));\n\n        char OOBR_stack = buff3[size3+100];\n        char OOBR_heap = buff4[100];\n\n        buff3[size3+100]='c';\n        buff4[100]='c';\n\n        if(size3>10){\n                buff4=0;\n        }\n        else{\n            free(buff4);\n        }\n\n        free(buff2);\n    }\n    fclose(fp);\n}\n\nint main(int argc,char **argv)\n{\n    ProcessImage(argv[1]);\n}\n```\n\nGPT-3的输出：\n```md\n检测到的漏洞：\n1. 未检查返回值：fopen()函数的返回值未被检查，可能导致空指针解引用。\n2. 越界读取：memcpy()函数用于将数据从img.data复制到buff1和buff2，但未检查目标缓冲区的大小，可能导致越界读取。\n3. 越界写入：buff3和buff4数组在未检查源缓冲区大小的情况下被写入，可能导致越界写入。\n4. 未初始化内存访问：OOBR_stack和OOBR_heap变量在未初始化的情况下被访问，可能导致未定义行为。\n5. 内存泄漏：如果size3变量大于10，则不会释放buff4数组，可能导致内存泄漏。\n```\n\nGPT-3在这5个漏洞中正确识别了4个。其中，漏洞1属于误报，因为代码中已经通过if(fp == NULL)语句检查了fopen()的返回值。此外，漏洞4的表述存在误导性——虽然确实存在两条未初始化内存访问的错误，但所提及的变量名并不准确。\n\n### 示例 4\n最后一个[Java示例](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner\u002Fblob\u002Fmain\u002FUnsafe%20Deserialization\u002FSerializeToFile.java)是我最喜欢的，因为遗憾的是，我第一次阅读这段代码时并未发现任何问题。在我看来，这段代码显得完全无害且“熟悉”——我在实际项目中见过类似的代码，却从未对此产生过任何疑虑。\n\n```java\nclass Utils\n{\n    \u002F\u002F 将对象序列化并写入文件的函数\n    public static void SerializeToFile(Object obj, String filename)\n    {\n        try\n        {\n            FileOutputStream file = new FileOutputStream(filename);\n            ObjectOutputStream out = new ObjectOutputStream(file);\n\n            \u002F\u002F 对对象进行序列化并写入文件\n            System.out.println(\"正在将 \" + obj.toString() + \" 序列化到 \" + filename);\n            out.writeObject(obj);\n\n            out.close();\n            file.close();\n        }\n        catch(Exception e)\n        {\n            System.out.println(\"异常: \" + e.toString());\n        }\n    }\n\n    \u002F\u002F 从文件反序列化对象的函数\n    public static Object DeserializeFromFile(String filename)\n    {\n        Object obj = new Object();\n\n        try\n        {\n            FileInputStream file = new FileInputStream(filename);\n            ObjectInputStream in = new ObjectInputStream(file);\n\n            \u002F\u002F 对对象进行反序列化\n            System.out.println(\"正在从 \" + filename 反序列化\");\n            obj = in.readObject();\n\n            in.close();\n            file.close();\n        }\n        catch(Exception e)\n        {\n            System.out.println(\"异常: \" + e.toString());\n        }\n\n        return obj;\n    }\n}\n```\n\nGPT-3的输出：\n```md\n检测到的漏洞：\n1. 不安全的反序列化：反序列化不受信任的数据可能导致远程代码执行。\n2. 文件权限不安全：所写入或读取的文件可能具有不安全的权限，从而允许未经授权的访问。\n```\n\nGPT-3再次给出了正确的结论。\n\n### 网络安全领域的终极“左移”\n“左移”是指在开发流程的早期阶段就应用安全实践，例如在代码部署到生产环境之前就进行安全漏洞测试。\n\n人工智能代码分析可以被视为网络安全领域终极意义上的“左移”，因为它能够在开发者*编写和提交代码*的过程中应用最佳安全实践，并对其进行网络安全教育。这不仅能够真正培养组织内部强大的安全文化，甚至有可能预防下一次重大黑客攻击，然而……\n\n不可否认的是，目前这项技术仍不够完善，它遗漏了一些经验丰富的网络安全专业人员在审计过程中绝不会忽视的问题。尽管如此，作为一款通用的大语言模型，它的表现仍然令人震惊，而且成本远低于其他替代方案。\n\nGPT-4目前尚未公布发布日期，但我相信随着其能力的不断提升，这类大语言模型将继续快速发展。\n\n### 误报\n在手动审查 GPT-3 检测到的 213 个漏洞中的大约 60 个之后，我发现的一个值得注意的误报出现在这个 [JavaScript 程序](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner\u002Fblob\u002Fmain\u002FUnsafe%20Deserialization\u002Funsafe.js) 的第 13 行：\n```js\nvar express = require('express');\nvar cookieParser = require('cookie-parser');\nvar escape = require('escape-html');\nvar serialize = require('node-serialize');\nvar app = express();\napp.use(cookieParser())\n \napp.get('\u002F', function(req, res) {\n if (req.cookies.profile) {\n   var str = new Buffer(req.cookies.profile, 'base64').toString();\n   var obj = serialize.unserialize(str);\n   if (obj.username) {\n     res.send(\"Hello \" + escape(obj.username)); \u002F\u002F \u003C--- GPT-3 在这里犯了错误\n   }\n } else {\n     res.cookie('profile', \"eyJ1c2VybmFtZSI6ImFqaW4iLCJjb3VudHJ5IjoiaW5kaWEiLCJjaXR5IjoiYmFuZ2Fsb3JlIn0=\", {\n       maxAge: 900000,\n       httpOnly: true\n     });\n }\n res.send(\"Hello World\");\n});\napp.listen(3000);\n```\nGPT-3 的输出：\n```md\n检测到的漏洞：\n- Cookie 设置不安全（未设置 secure 标志）\n- 对用户输入（Cookie）进行未经验证的反序列化\n- 由于未对用户输入（用户名）进行转义，可能存在 XSS 漏洞\n```\nGPT-3 对前两个漏洞的判断是正确的，但第三个漏洞属于误报——`obj.username` 实际上已经进行了转义，而 GPT-3 却认为没有进行转义。\n\n## 结果\n实验结果显示，GPT-3 能够在扫描的 129 个文件中检测出 85 个文件存在安全漏洞。这一结果相当令人印象深刻！\n\n脚本 [`summarize_results.py`](summarize_results.py) 会生成 GPT-3 检测结果的摘要：\n```\n在 129 个文件中，共检测出 86 个文件存在漏洞。\n总共检测出 213 个漏洞。\n\nGPT-3 回答中常用开场句的频率（每扫描一个文件生成一条回答）：\n{'vulnerabilities detected': 73, 'no vulnerabilities detected.': 43, 'vulnerability detected': 6, 'answer': 2, 'potential vulnerabilities detected': 2, 'analysis': 1, 'security vulnerabilities detected': 1, 'no response given': 1} \n\n扫描文件类型的分布： \n总共 129 个代码文件（不包括 Markdown 和纯文本文件）\n{'.php': 50, '.js': 20, '.cs': 16, '.c': 14, '.java': 9, '.py': 8, '.rb': 5, '.asp': 3, '.ts': 2, '.go': 1, '.html': 1}\n```\n\n### 与商业产品的对比\n为了完善本次实验，我将 GPT-3 的检测结果与一款商用代码漏洞扫描工具 [Snyk Code](https:\u002F\u002Fsnyk.io\u002Fproduct\u002Fsnyk-code\u002F) 进行了比较。Snyk Code 是由 Snyk 公司开发的，我认为该公司的产品非常出色。使用 Snyk Code 扫描该仓库后，共发现了 99 个安全漏洞，而 GPT-3 则检测出了 213 个。\n\n![Snyk 的扫描结果](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fchris-koch-penn_gpt3_security_vulnerability_scanner_readme_4791196468b3.png)\n\n造成这一差异的一个因素是，Snyk Code 只支持部分编程语言，因此它仅能扫描约 103 个文件，而 GPT-3 则扫描了 129 个文件。\n\n### 最后的话\n如果您有兴趣看到这项实验最终发展成一款完整的产品，请通过这份简短的 [Google 表单](https:\u002F\u002Fforms.gle\u002FmXy8NVZb5fshqCAt6) 表达您的兴趣。\n\n此仓库中的漏洞代码片段均来自 [snoopysecurity\u002FVulnerable-Code-Snippets](https:\u002F\u002Fgithub.com\u002Fsnoopysecurity\u002FVulnerable-Code-Snippets)，这是一个非常优秀的资源。我尽量移除了代码片段中可能暗示其中包含哪些安全漏洞的注释。为此，我还删除了那些包含这些示例片段来源博客文章和资料链接的注释。原始仓库中的所有引用信息都可以在 [attributions.md](https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner\u002Fblob\u002Fmain\u002Fattributions.md) 文件中找到。","# gpt3_security_vulnerability_scanner 快速上手指南\n\n本工具是一个实验性项目，旨在利用 OpenAI 的 GPT-3 模型（text-davinci-003）检测代码中的安全漏洞。它通过逐文件分析源代码，识别如缓冲区溢出、日志注入、不安全反序列化等常见安全问题。\n\n> **注意**：本项目主要作为概念验证（PoC），依赖 OpenAI API 密钥，并非传统的“一键安装”命令行工具。以下指南将指导您如何配置环境并运行扫描逻辑。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Linux, macOS 或 Windows (需配备 Python 环境)\n*   **Python 版本**：Python 3.8 或更高版本\n*   **依赖项**：\n    *   `openai` Python 库\n    *   有效的 OpenAI API Key (需访问 `text-davinci-003` 或兼容的 GPT-3.5\u002F4 模型)\n*   **网络环境**：能够访问 OpenAI API 服务（国内用户可能需要配置代理或使用镜像中转服务）\n\n## 安装步骤\n\n1.  **克隆项目仓库**\n    获取源代码到本地：\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fchris-koch-penn\u002Fgpt3_security_vulnerability_scanner.git\n    cd gpt3_security_vulnerability_scanner\n    ```\n\n2.  **安装 Python 依赖**\n    项目中通常包含 `requirements.txt`，如果没有，请手动安装核心依赖：\n    ```bash\n    pip install openai\n    # 如果项目根目录有 requirements.txt，推荐使用：\n    # pip install -r requirements.txt\n    ```\n\n3.  **配置 API 密钥**\n    设置环境变量以授权访问 GPT-3 模型。\n    \n    *Linux\u002FmacOS:*\n    ```bash\n    export OPENAI_API_KEY=\"sk-your-api-key-here\"\n    ```\n    \n    *Windows (PowerShell):*\n    ```powershell\n    $env:OPENAI_API_KEY=\"sk-your-api-key-here\"\n    ```\n\n## 基本使用\n\n由于该工具的核心逻辑是调用 LLM 对代码片段进行分析，使用方法主要分为**直接查看示例结果**和**编写脚本调用 API**两种方式。\n\n### 方式一：查看内置分析示例\n项目仓库已按漏洞类型分类整理了大量测试用例，并附带了 GPT-3 的分析结果。您可以直接浏览这些文件了解检测效果。\n\n例如，查看格式字符串攻击的检测示例：\n```bash\ncat \"Format String Attacks\u002FREADME.md\"\n```\n或者查看具体的漏洞代码与分析对比：\n```bash\n# 查看 C 语言漏洞源码\ncat \"Format String Attacks\u002FFormatString.c\"\n\n# 查看对应的 GPT-3 分析报告 (通常在文件夹内的 README 中)\ncat \"Format String Attacks\u002FREADME.md\"\n```\n\n### 方式二：自定义扫描脚本\n您可以编写一个简单的 Python 脚本来扫描自己的代码文件。以下是最小化实现示例：\n\n```python\nimport openai\nimport os\n\n# 初始化客户端 (确保已设置 OPENAI_API_KEY 环境变量)\nclient = openai.OpenAI()\n\ndef scan_file_for_vulnerabilities(code_path):\n    with open(code_path, 'r', encoding='utf-8') as f:\n        code_content = f.read()\n\n    # 构建提示词\n    prompt = f\"\"\"\n    Analyze the following code for security vulnerabilities. \n    List each vulnerability found with a brief explanation.\n    \n    Code:\n    {code_content}\n    \"\"\"\n\n    try:\n        response = client.chat.completions.create(\n            model=\"gpt-3.5-turbo\", # 或 text-davinci-003 (如果可用)\n            messages=[{\"role\": \"user\", \"content\": prompt}],\n            max_tokens=1000,\n            temperature=0\n        )\n        print(response.choices[0].message.content)\n    except Exception as e:\n        print(f\"Error: {e}\")\n\n# 使用示例\n# scan_file_for_vulnerabilities(\".\u002Fpath\u002Fto\u002Fyour\u002Fcode.py\")\n```\n\n**使用说明：**\n1.  将上述代码保存为 `scanner.py`。\n2.  修改 `scan_file_for_vulnerabilities` 函数中的路径为您想要检测的文件。\n3.  运行脚本：\n    ```bash\n    python scanner.py\n    ```\n\n**限制说明：**\n*   **上下文窗口**：GPT-3 上下文限制约为 4000 tokens（约 3000 英文单词），因此每次只能扫描单个文件或较小的代码片段。\n*   **跨文件依赖**：工具难以检测涉及多个文件交互的复杂漏洞，除非导入\u002F导出关系非常明确。\n*   **误报率**：根据原作者测试，随机抽样中约有少量误报，建议结合人工复核。","某金融科技初创团队在上线前对核心交易系统的遗留代码库进行紧急安全审计，试图在有限时间内排查潜在风险。\n\n### 没有 gpt3_security_vulnerability_scanner 时\n- 依赖传统商业扫描器仅发现 99 个已知问题，漏掉了大量隐蔽的逻辑漏洞和新型攻击向量。\n- 人工复核成本极高，资深安全专家需逐行阅读数千行代码，难以覆盖全部 129 个高风险文件。\n- 对于涉及常用库（如 Express.js 或 C 标准库）的交互逻辑，传统工具因无法理解上下文而频繁报错或静默失败。\n- 误报率虽低但漏报严重，团队无法确定是否还有未被发现的致命隐患，上线决策陷入两难。\n\n### 使用 gpt3_security_vulnerability_scanner 后\n- 利用 GPT-3 的语义理解能力，成功识别出 213 个安全漏洞，数量是传统商业工具的两倍以上。\n- 随机抽检显示误报率极低（60 个样本中仅 4 个误报），大幅减少了安全团队手动验证无效警报的时间。\n- 即使不查看导入库的源码，gpt3_security_vulnerability_scanner 也能凭借对常见库的“记忆”准确判断跨文件调用的安全风险。\n- 快速定位了包括格式化字符串攻击在内的多种复杂漏洞，让团队有信心在修复后按时发布系统。\n\ngpt3_security_vulnerability_scanner 通过超越传统规则的语义分析，将代码审计从“大海捞针”转变为高效精准的主动防御。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fchris-koch-penn_gpt3_security_vulnerability_scanner_aeed7fec.png","chris-koch-penn","Chris Koch","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fchris-koch-penn_33f74033.png",null,"https:\u002F\u002Fgithub.com\u002Fchris-koch-penn",[82,86,90,94,98,102,106,110,114,118],{"name":83,"color":84,"percentage":85},"PHP","#4F5D95",29.1,{"name":87,"color":88,"percentage":89},"JavaScript","#f1e05a",17.5,{"name":91,"color":92,"percentage":93},"C#","#178600",15.6,{"name":95,"color":96,"percentage":97},"Python","#3572A5",15.5,{"name":99,"color":100,"percentage":101},"C","#555555",11.2,{"name":103,"color":104,"percentage":105},"Java","#b07219",6.6,{"name":107,"color":108,"percentage":109},"Classic ASP","#6a40fd",1.7,{"name":111,"color":112,"percentage":113},"Ruby","#701516",1.6,{"name":115,"color":116,"percentage":117},"Go","#00ADD8",0.6,{"name":119,"color":120,"percentage":121},"TypeScript","#3178c6",0.5,600,104,"2026-03-17T07:54:21","","未说明",{"notes":128,"python":126,"dependencies":129},"该工具并非本地运行的开源软件，而是基于 OpenAI GPT-3 API (text-davinci-003) 的实验性项目。它通过调用外部 API 逐文件扫描代码，因此无需本地 GPU、特定显存或安装深度学习框架（如 PyTorch\u002FTensorFlow）。运行环境仅需能连接互联网并调用 OpenAI API 的基础开发环境。由于依赖云端模型，其性能受限于 API 的上下文窗口（4000 tokens），无法一次性处理整个代码仓库，且会产生 API 调用费用。",[],[15,46],"2026-03-27T02:49:30.150509","2026-04-07T13:29:25.873658",[],[]]