[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-trailofbits--fickling":3,"tool-trailofbits--fickling":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},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 真正成长为懂上",149489,2,"2026-04-10T11:32:46",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":32,"last_commit_at":59,"category_tags":60,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":77,"owner_email":78,"owner_twitter":73,"owner_website":79,"owner_url":80,"languages":81,"stars":90,"forks":91,"last_commit_at":92,"license":93,"difficulty_score":94,"env_os":95,"env_gpu":96,"env_ram":96,"env_deps":97,"category_tags":102,"github_topics":103,"view_count":32,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":107,"updated_at":108,"faqs":109,"releases":140},6298,"trailofbits\u002Ffickling","fickling","A Python pickling decompiler and static analyzer","Fickling 是一款专为 Python pickle 序列化文件设计的反编译器、静态分析器及字节码重写工具。它主要解决了 AI 与机器学习领域中广泛存在的安全隐患：由于 pickle 格式在加载时可能自动执行恶意代码，攻击者常利用伪造的模型文件（如 PyTorch 权重）窃取数据或控制服务器。\n\nFickling 通过挂钩（hook）Python 的 pickle 模块，在文件加载前自动拦截并检查其导入行为。它内置了针对主流机器学习库的安全白名单机制，一旦检测到试图调用非授权模块的恶意指令，便会立即阻断加载过程并抛出异常，从而有效防止任意代码执行。此外，它还支持将混淆的 pickle 字节码还原为可读的 Python 代码，帮助安全研究人员逆向分析潜在的威胁逻辑。\n\n这款工具非常适合 AI 工程师、数据安全研究员以及需要部署第三方模型的开发者使用。无论是作为命令行工具进行批量扫描，还是作为库集成到生产环境中实现运行时防护，Fickling 都能提供灵活且强大的支持。其独特的亮点在于不仅能“防御”，还能“透视”文件内部逻辑，甚至支持创建用于测试的复杂多态文件，是构建可信 AI 基础设","Fickling 是一款专为 Python pickle 序列化文件设计的反编译器、静态分析器及字节码重写工具。它主要解决了 AI 与机器学习领域中广泛存在的安全隐患：由于 pickle 格式在加载时可能自动执行恶意代码，攻击者常利用伪造的模型文件（如 PyTorch 权重）窃取数据或控制服务器。\n\nFickling 通过挂钩（hook）Python 的 pickle 模块，在文件加载前自动拦截并检查其导入行为。它内置了针对主流机器学习库的安全白名单机制，一旦检测到试图调用非授权模块的恶意指令，便会立即阻断加载过程并抛出异常，从而有效防止任意代码执行。此外，它还支持将混淆的 pickle 字节码还原为可读的 Python 代码，帮助安全研究人员逆向分析潜在的威胁逻辑。\n\n这款工具非常适合 AI 工程师、数据安全研究员以及需要部署第三方模型的开发者使用。无论是作为命令行工具进行批量扫描，还是作为库集成到生产环境中实现运行时防护，Fickling 都能提供灵活且强大的支持。其独特的亮点在于不仅能“防御”，还能“透视”文件内部逻辑，甚至支持创建用于测试的复杂多态文件，是构建可信 AI 基础设施的重要帮手。","# Fickling\n\n![Fickling image](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftrailofbits_fickling_readme_383d1176047f.png)\n\nFickling is a decompiler, static analyzer, and bytecode rewriter for Python\n[pickle](https:\u002F\u002Fdocs.python.org\u002F3\u002Flibrary\u002Fpickle.html) object serializations.\nYou can use fickling to detect, analyze, reverse engineer, or even create\nmalicious pickle or pickle-based files, including PyTorch files.\n\nFickling can be used both as a **python library** and a **CLI**.\n\n* [Installation](#installation)\n* [Securing AI\u002FML environments](#securing-aiml-environments)\n* [Generic malicious file detection](#generic-malicious-file-detection)\n* [Advanced usage](#advanced-usage)\n  * [Trace pickle execution](#trace-pickle-execution)\n  * [Pickle code injection](#pickle-code-injection)\n  * [Pickle decompilation](#pickle-decompilation)\n  * [PyTorch polyglots](#pytorch-polyglots)\n* [More information](#more-information)\n* [Contact](#contact)\n\n## Installation\n\nFickling has been tested on Python 3.9 through Python 3.13 and has very few dependencies.\nBoth the library and command line utility can be installed through pip or uv:\n\n```bash\n# Using pip\npython -m pip install fickling\n\n# Using uv\nuv pip install fickling\n```\n\nPyTorch is an optional dependency of Fickling. Therefore, in order to use Fickling's `pytorch`\nand `polyglot` modules, you should run:\n\n```bash\n# Using pip\npython -m pip install fickling[torch]\n\n# Using uv\nuv pip install fickling[torch]\n```\n\n## Securing AI\u002FML environments\n\nFickling can help securing AI\u002FML codebases by automatically scanning pickle files contained in\nmodels. Fickling hooks the pickle module and verifies imports made when loading a model. It only\nchecks the imports against an allowlist of imports from ML libraries that are considered safe, and blocks files that contain other imports.\n\nTo enable Fickling security checks simply run the following lines once in your process, before loading any AI\u002FML models:\n\n```python\nimport fickling\n# This sets global hooks on pickle\nfickling.hook.activate_safe_ml_environment()\n```\n\nTo remove the protection:\n\n```python\nfickling.hook.deactivate_safe_ml_environment()\n```\n\nIt is possible that the models you are using contain imports that aren't allowed by Fickling. If you still want to load the model, you can simply allow additional imports for your specific use-case with the `also_allow` argument:\n\n```python\nfickling.hook.activate_safe_ml_environment(also_allow=[\n    \"some.import\",\n    \"another.allowed.import\",\n])\n```\n\n**Important**: You should always make sure that manually added imports are actually safe and can not enable attackers to execute arbitrary code. If you are unsure on how to do that, you can open an issue on Fickling's Github repository that indicates the imports\u002Fmodels in question, and our team can review them and include them in the allow list if possible.\n\n## Generic malicious file detection\n\nFickling can seamlessly be integrated into your codebase to detect and halt the loading of malicious\nfiles at runtime.\n\nBelow we show the different ways you can use fickling to enforce safety checks on pickle files.\nUnder the hood, it hooks the `pickle` library to add safety checks so that loading a pickle file\nraises an `UnsafeFileError` exception if malicious content is detected in the file.\n\n#### Option 1 (recommended): check safety of all pickle files loaded\n\n```python\n# This enforces safety checks every time pickle is used to deserialize\nfickling.always_check_safety()\n\n# Attempt to load an unsafe file now raises an exception\nwith open(\"file.pkl\", \"rb\") as f:\n    try:\n        pickle.load(f)\n    except fickling.UnsafeFileError:\n        print(\"Unsafe file!\")\n```\n\n#### Option 2: use a context manager\n\n```python\nwith fickling.check_safety():\n    # All pickle files loaded within the context manager are checked for safety\n    try:\n        with open(\"file.pkl\", \"rb\") as f:\n            pickle.load(\"file.pkl\")\n    except fickling.UnsafeFileError:\n        print(\"Unsafe file!\")\n\n# Files loaded outside of context manager are NOT checked\npickle.load(\"file.pkl\")\n```\n\n#### Option 3: check and load a single file\n\n```python\n# Use fickling.load() in place of pickle.load() to check safety and load a single pickle file\ntry:\n    fickling.load(\"file.pkl\")\nexcept fickling.UnsafeFileError as e:\n    print(\"Unsafe file!\")\n```\n\n#### Option 4: only check pickle file safety without loading\n\n```python3\n# Perform a safety check on a pickle file without loading it\nif not fickling.is_likely_safe(\"file.pkl\"):\n    print(\"Unsafe file!\")\n```\n\n#### Accessing the safety analysis results\n\nYou can access the details of fickling's safety analysis from within the raised exception:\n\n```python\n\n>>> try:\n...     fickling.load(\"unsafe.pkl\")\n... except fickling.UnsafeFileError as e:\n...     print(e.info)\n\n{\n    \"severity\": \"OVERTLY_MALICIOUS\",\n    \"analysis\": \"Call to `eval(b'[5, 6, 7, 8]')` is almost certainly evidence of a malicious pickle file. Variable `_var0` is assigned value `eval(b'[5, 6, 7, 8]')` but unused afterward; this is suspicious and indicative of a malicious pickle file\",\n    \"detailed_results\": {\n        \"AnalysisResult\": {\n            \"OvertlyBadEval\": \"eval(b'[5, 6, 7, 8]')\",\n            \"UnusedVariables\": [\n                \"_var0\",\n                \"eval(b'[5, 6, 7, 8]')\"\n            ]\n        }\n    }\n}\n```\n\nIf you are using another language than Python, you can still use fickling's `CLI` to\nsafety-check pickle files:\n\n```console\nfickling --check-safety -p pickled.data\n```\n\n## Advanced usage\n\n### Trace pickle execution\n\nFickling's `CLI` allows to safely trace the execution of the Pickle virtual machine without\nexercising any malicious code:\n\n```console\nfickling --trace file.pkl\n```\n\n### Pickle code injection\n\nFickling allows to inject arbitrary code in a pickle file that will run every time the file is loaded\n\n```console\nfickling --inject \"print('Malicious')\" file.pkl > malicious.pkl\n```\n\n### Pickle decompilation\n\nFickling can be used to decompile a pickle file for further analysis\n\n```python\n>>> import ast, pickle\n>>> from fickling.fickle import Pickled\n>>> fickled_object = Pickled.load(pickle.dumps([1, 2, 3, 4]))\n>>> print(ast.dump(fickled_object.ast, indent=4))\nModule(\n    body=[\n        Assign(\n            targets=[\n                Name(id='result', ctx=Store())],\n            value=List(\n                elts=[\n                    Constant(value=1),\n                    Constant(value=2),\n                    Constant(value=3),\n                    Constant(value=4)],\n                ctx=Load()))],\n    type_ignores=[])\n```\n\n### PyTorch polyglots\n\nPyTorch contains multiple file formats with which one can make polyglot files, which\nare files that can be validly interpreted as more than one file format.\nFickling supports identifying, inspecting, and creating polyglots with the\nfollowing PyTorch file formats:\n\n* **PyTorch v0.1.1**: Tar file with sys_info, pickle, storages, and tensors\n* **PyTorch v0.1.10**: Stacked pickle files\n* **TorchScript v1.0**: ZIP file with model.json\n* **TorchScript v1.1**: ZIP file with model.json and attributes.pkl\n* **TorchScript v1.3**: ZIP file with data.pkl and constants.pkl\n* **TorchScript v1.4**: ZIP file with data.pkl, constants.pkl, and version set at 2 or higher (2 pickle files and a folder)\n* **PyTorch v1.3**: ZIP file containing data.pkl (1 pickle file)\n* **PyTorch model archive format[ZIP]**: ZIP file that includes Python code files and pickle files\n\n```python\n>> import torch\n>> import torchvision.models as models\n>> from fickling.pytorch import PyTorchModelWrapper\n>> model = models.mobilenet_v2()\n>> torch.save(model, \"mobilenet.pth\")\n>> fickled_model = PyTorchModelWrapper(\"mobilenet.pth\")\n>> print(fickled_model.formats)\nYour file is most likely of this format:  PyTorch v1.3\n['PyTorch v1.3']\n```\n\nCheck out [our examples](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Ftree\u002Fmaster\u002Fexample)\nto learn more about using fickling!\n\n## More information\n\nPickled Python objects are in fact bytecode that is interpreted by a stack-based\nvirtual machine built into Python called the \"Pickle Machine\". Fickling can take\npickled data streams and decompile them into human-readable Python code that,\nwhen executed, will deserialize to the original serialized object. This is made\npossible by Fickling’s custom implementation of the PM. Fickling is safe to run\non potentially malicious files because its PM symbolically executes code rather\nthan overtly executing it.\n\nThe authors do not prescribe any meaning to the “F” in Fickling; it could stand\nfor “fickle,” … or something else. Divining its meaning is a personal journey\nin discretion and is left as an exercise to the reader.\n\nLearn more about fickling in our\n[blog post](https:\u002F\u002Fblog.trailofbits.com\u002F2021\u002F03\u002F15\u002Fnever-a-dill-moment-exploiting-machine-learning-pickle-files\u002F)\nand [DEF CON AI Village 2021 talk](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=bZ0m_H_dEJI).\n\n## Contact\n\nIf you'd like to file a bug report or feature request, please use our\n[issues](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fissues) page.\nFeel free to contact us or reach out in\n[Empire Hacking](https:\u002F\u002Fslack.empirehacking.nyc\u002F) for help using or extending fickling.\n\n## License\n\nThis utility was developed by [Trail of Bits](https:\u002F\u002Fwww.trailofbits.com\u002F).\nIt is licensed under the [GNU Lesser General Public License v3.0](LICENSE).\n[Contact us](mailto:opensource@trailofbits.com) if you're looking for an\nexception to the terms.\n\n© 2021, Trail of Bits.\n","# Fickling\n\n![Fickling 图片](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftrailofbits_fickling_readme_383d1176047f.png)\n\nFickling 是一个针对 Python `pickle` 对象序列化的反编译器、静态分析工具和字节码重写器。你可以使用 Fickling 来检测、分析、逆向工程，甚至创建恶意的 pickle 或基于 pickle 的文件，包括 PyTorch 文件。\n\nFickling 既可以作为 **Python 库** 使用，也可以作为 **命令行工具** 使用。\n\n* [安装](#installation)\n* [保护 AI\u002FML 环境](#securing-aiml-environments)\n* [通用恶意文件检测](#generic-malicious-file-detection)\n* [高级用法](#advanced-usage)\n  * [跟踪 pickle 执行](#trace-pickle-execution)\n  * [Pickle 代码注入](#pickle-code-injection)\n  * [Pickle 反编译](#pickle-decompilation)\n  * [PyTorch 多语言文件](#pytorch-polyglots)\n* [更多信息](#more-information)\n* [联系方式](#contact)\n\n## 安装\n\nFickling 已在 Python 3.9 到 Python 3.13 上进行了测试，且依赖非常少。库和命令行工具都可以通过 pip 或 uv 进行安装：\n\n```bash\n# 使用 pip\npython -m pip install fickling\n\n# 使用 uv\nuv pip install fickling\n```\n\nPyTorch 是 Fickling 的可选依赖。因此，为了使用 Fickling 的 `pytorch` 和 `polyglot` 模块，你需要运行以下命令：\n\n```bash\n# 使用 pip\npython -m pip install fickling[torch]\n\n# 使用 uv\nuv pip install fickling[torch]\n```\n\n## 保护 AI\u002FML 环境\n\nFickling 可以通过自动扫描模型中包含的 pickle 文件来帮助保护 AI\u002FML 代码库。Fickling 会钩住 pickle 模块，并在加载模型时验证导入的模块。它只会检查这些导入是否来自被认为是安全的 ML 库的白名单，而阻止包含其他导入的文件。\n\n要启用 Fickling 的安全检查，只需在你的程序中，在加载任何 AI\u002FML 模型之前运行以下代码一次：\n\n```python\nimport fickling\n# 这会在 pickle 上设置全局钩子\nfickling.hook.activate_safe_ml_environment()\n```\n\n要移除保护措施：\n\n```python\nfickling.hook.deactivate_safe_ml_environment()\n```\n\n你使用的模型可能包含 Fickling 不允许的导入。如果你仍然想加载该模型，可以使用 `also_allow` 参数为你的特定用例添加额外的允许导入：\n\n```python\nfickling.hook.activate_safe_ml_environment(also_allow=[\n    \"some.import\",\n    \"another.allowed.import\",\n])\n```\n\n**重要提示**：你应始终确保手动添加的导入是安全的，不会使攻击者能够执行任意代码。如果你不确定如何操作，可以在 Fickling 的 GitHub 仓库中提交一个问题，说明相关的导入或模型，我们的团队将对其进行审查，并在可能的情况下将其加入白名单。\n\n## 通用恶意文件检测\n\nFickling 可以无缝集成到你的代码库中，以便在运行时检测并阻止恶意文件的加载。\n\n下面我们展示了使用 Fickling 对 pickle 文件强制执行安全检查的不同方式。在底层，它会钩住 `pickle` 库以添加安全检查，从而使得加载 pickle 文件时，如果检测到恶意内容，就会抛出 `UnsafeFileError` 异常。\n\n#### 方案 1（推荐）：检查所有加载的 pickle 文件的安全性\n\n```python\n# 这会在每次使用 pickle 进行反序列化时强制执行安全检查\nfickling.always_check_safety()\n\n# 尝试加载不安全的文件现在会抛出异常\nwith open(\"file.pkl\", \"rb\") as f:\n    try:\n        pickle.load(f)\n    except fickling.UnsafeFileError:\n        print(\"不安全的文件！\")\n```\n\n#### 方案 2：使用上下文管理器\n\n```python\nwith fickling.check_safety():\n    # 在上下文管理器内加载的所有 pickle 文件都会被检查安全性\n    try:\n        with open(\"file.pkl\", \"rb\") as f:\n            pickle.load(f)\n    except fickling.UnsafeFileError:\n        print(\"不安全的文件！\")\n\n# 在上下文管理器之外加载的文件不会被检查\npickle.load(\"file.pkl\")\n```\n\n#### 方案 3：检查并加载单个文件\n\n```python\n# 使用 fickling.load() 替代 pickle.load() 来检查安全性并加载单个 pickle 文件\ntry:\n    fickling.load(\"file.pkl\")\nexcept fickling.UnsafeFileError as e:\n    print(\"不安全的文件！\")\n```\n\n#### 方案 4：仅检查 pickle 文件的安全性而不加载\n\n```python\n# 在不加载的情况下对 pickle 文件进行安全检查\nif not fickling.is_likely_safe(\"file.pkl\"):\n    print(\"不安全的文件！\")\n```\n\n#### 访问安全分析结果\n\n你可以从抛出的异常中获取 Fickling 安全分析的详细信息：\n\n```python\n>>> try:\n...     fickling.load(\"unsafe.pkl\")\n... except fickling.UnsafeFileError as e:\n...     print(e.info)\n\n{\n    \"severity\": \"OVERTLY_MALICIOUS\",\n    \"analysis\": \"调用 `eval(b'[5, 6, 7, 8]')` 几乎可以肯定是一份恶意 pickle 文件的证据。变量 `_var0` 被赋值为 `eval(b'[5, 6, 7, 8]')`，但之后未被使用；这一点很可疑，表明这是一份恶意 pickle 文件\",\n    \"detailed_results\": {\n        \"AnalysisResult\": {\n            \"OvertlyBadEval\": \"eval(b'[5, 6, 7, 8]')\",\n            \"UnusedVariables\": [\n                \"_var0\",\n                \"eval(b'[5, 6, 7, 8]')\"\n            ]\n        }\n    }\n}\n```\n\n如果你使用的是 Python 以外的语言，仍然可以使用 Fickling 的 `CLI` 来对 pickle 文件进行安全检查：\n\n```console\nfickling --check-safety -p pickled.data\n```\n\n## 高级用法\n\n### 跟踪 pickle 执行\n\nFickling 的 `CLI` 允许安全地跟踪 Pickle 虚拟机的执行过程，而无需执行任何恶意代码：\n\n```console\nfickling --trace file.pkl\n```\n\n### Pickle 代码注入\n\nFickling 允许在 pickle 文件中注入任意代码，这些代码将在每次加载文件时执行。\n\n```console\nfickling --inject \"print('Malicious')\" file.pkl > malicious.pkl\n```\n\n### Pickle 反编译\n\nFickling 可以用于反编译 pickle 文件，以便进一步分析。\n\n```python\n>>> import ast, pickle\n>>> from fickling.fickle import Pickled\n>>> fickled_object = Pickled.load(pickle.dumps([1, 2, 3, 4]))\n>>> print(ast.dump(fickled_object.ast, indent=4))\nModule(\n    body=[\n        Assign(\n            targets=[\n                Name(id='result', ctx=Store())],\n            value=List(\n                elts=[\n                    Constant(value=1),\n                    Constant(value=2),\n                    Constant(value=3),\n                    Constant(value=4)],\n                ctx=Load()))],\n    type_ignores=[])\n```\n\n### PyTorch 多格式文件\n\nPyTorch 包含多种文件格式，可以用来创建多格式文件，即能够被正确解析为多种不同文件格式的文件。\nFickling 支持识别、检查和创建以下 PyTorch 文件格式的多格式文件：\n\n* **PyTorch v0.1.1**：包含 sys_info、pickle、storages 和 tensors 的 tar 文件\n* **PyTorch v0.1.10**：堆叠的 pickle 文件\n* **TorchScript v1.0**：包含 model.json 的 ZIP 文件\n* **TorchScript v1.1**：包含 model.json 和 attributes.pkl 的 ZIP 文件\n* **TorchScript v1.3**：包含 data.pkl 和 constants.pkl 的 ZIP 文件\n* **TorchScript v1.4**：包含 data.pkl、constants.pkl，并且版本号设置为 2 或更高（2 个 pickle 文件和一个文件夹）的 ZIP 文件\n* **PyTorch v1.3**：包含 data.pkl 的 ZIP 文件\n* **PyTorch 模型归档格式[ZIP]**：包含 Python 代码文件和 pickle 文件的 ZIP 文件\n\n```python\n>> import torch\n>> import torchvision.models as models\n>> from fickling.pytorch import PyTorchModelWrapper\n>> model = models.mobilenet_v2()\n>> torch.save(model, \"mobilenet.pth\")\n>> fickled_model = PyTorchModelWrapper(\"mobilenet.pth\")\n>> print(fickled_model.formats)\n您的文件最有可能是这种格式： PyTorch v1.3\n['PyTorch v1.3']\n```\n\n请查看 [我们的示例](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Ftree\u002Fmaster\u002Fexample)，了解更多关于如何使用 Fickling 的信息！\n\n## 更多信息\n\n实际上，pickle 格式的 Python 对象是字节码，由 Python 内置的基于栈的虚拟机“Pickle Machine”来解释执行。Fickling 可以将这些 pickle 数据流反编译成人类可读的 Python 代码，当这些代码被执行时，会反序列化为原始的序列化对象。这是通过 Fickling 自定义实现的 PM 来实现的。Fickling 在处理潜在恶意文件时是安全的，因为它采用符号执行的方式运行代码，而不是直接执行。\n\n作者并未对 Fickling 中的“F”赋予特定含义；它可以代表“fickle”（善变的），也可以是其他意思。解读其具体含义是一次个人的判断之旅，留给读者自行思考。\n\n您可以在我们的\n[博客文章](https:\u002F\u002Fblog.trailofbits.com\u002F2021\u002F03\u002F15\u002Fnever-a-dill-moment-exploiting-machine-learning-pickle-files\u002F)\n以及\n[DEF CON AI Village 2021 演讲](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=bZ0m_H_dEJI)\n中了解更多关于 Fickling 的信息。\n\n## 联系方式\n\n如果您想提交 bug 报告或功能请求，请使用我们的\n[issues 页面](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fissues)。\n您也可以随时联系我们，或在\n[Empire Hacking](https:\u002F\u002Fslack.empirehacking.nyc\u002F) 中寻求帮助，以使用或扩展 Fickling。\n\n## 许可证\n\n本工具由 [Trail of Bits](https:\u002F\u002Fwww.trailofbits.com\u002F) 开发。它根据\n[GNU Lesser General Public License v3.0](LICENSE) 进行许可。\n如果您希望获得条款的例外，请联系\n[opensource@trailofbits.com]。\n\n© 2021, Trail of Bits。","# Fickling 快速上手指南\n\nFickling 是一款针对 Python `pickle` 序列化数据的反编译器、静态分析器和字节码重写工具。它主要用于检测、分析、逆向工程甚至创建恶意的 pickle 文件（包括 PyTorch 模型文件），是保障 AI\u002FML 环境安全的重要工具。\n\n## 环境准备\n\n*   **操作系统**：支持 Linux, macOS, Windows。\n*   **Python 版本**：Python 3.9 至 3.13。\n*   **前置依赖**：\n    *   基础功能仅需极少依赖。\n    *   若需使用 PyTorch 相关模块（如 `pytorch` 和 `polyglot`），需预先安装 PyTorch 或直接安装带 torch 扩展的 fickling。\n\n## 安装步骤\n\n推荐使用 `pip` 或 `uv` 进行安装。国内开发者如遇网络问题，可配置清华或阿里镜像源加速。\n\n### 1. 安装基础版\n仅包含核心库和命令行工具，适用于通用的 pickle 文件安全检测。\n\n```bash\n# 使用 pip (推荐配置国内镜像)\npython -m pip install fickling -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n\n# 或使用 uv\nuv pip install fickling\n```\n\n### 2. 安装完整版（含 PyTorch 支持）\n如果您需要分析 PyTorch 模型文件或处理多格式混合文件（Polyglots），请安装此版本。\n\n```bash\n# 使用 pip (推荐配置国内镜像)\npython -m pip install \"fickling[torch]\" -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n\n# 或使用 uv\nuv pip install \"fickling[torch]\"\n```\n\n## 基本使用\n\nFickling 既可作为 Python 库在代码中调用，也可作为命令行工具（CLI）直接使用。\n\n### 场景一：在代码中自动拦截恶意文件加载\n这是保护 AI\u002FML 环境最推荐的方式。启用后，任何尝试加载包含不安全导入（如任意代码执行）的 pickle 文件的操作都会抛出 `UnsafeFileError` 异常。\n\n```python\nimport pickle\nimport fickling\n\n# 激活全局安全钩子，限制只允许安全的 ML 库导入\nfickling.hook.activate_safe_ml_environment()\n\n# 此时加载恶意文件将直接报错\ntry:\n    with open(\"suspicious_model.pkl\", \"rb\") as f:\n        data = pickle.load(f)\nexcept fickling.UnsafeFileError as e:\n    print(\"检测到不安全文件！\")\n    # 可查看详细的分析报告\n    print(e.info)\n```\n\n若需临时允许特定的非标准导入，可使用 `also_allow` 参数：\n```python\nfickling.hook.activate_safe_ml_environment(also_allow=[\"my_custom.safe_module\"])\n```\n\n### 场景二：使用命令行快速检测文件\n无需编写代码，直接通过终端检查单个 pickle 文件的安全性。\n\n```bash\n# 检查文件安全性\nfickling --check-safety -p suspicious_model.pkl\n```\n\n### 场景三：反编译 pickle 文件\n将 pickle 字节码还原为可读的 Python AST 代码，用于逆向分析。\n\n```python\nimport ast\nimport pickle\nfrom fickling.fickle import Pickled\n\n# 加载 pickle 数据\ndata = pickle.dumps([1, 2, 3])\nfickled_object = Pickled.load(data)\n\n# 输出反编译后的 Python 代码结构\nprint(ast.dump(fickled_object.ast, indent=4))\n```\n\n### 场景四：追踪执行流程（沙箱模式）\n安全地追踪 pickle 虚拟机的执行过程，而不会实际执行其中的恶意代码。\n\n```bash\nfickling --trace suspicious_model.pkl\n```","某 AI 初创团队在从公开社区下载预训练 PyTorch 模型进行微调时，面临未知的代码执行风险。\n\n### 没有 fickling 时\n- 加载 `.pt` 或 `.pkl` 模型文件如同“开盲盒”，无法预判文件中是否隐藏了恶意导入（如 `os.system`）以窃取服务器数据。\n- 安全审计只能依赖人工反编译字节码，面对复杂的混淆代码效率极低，且极易遗漏深层逻辑漏洞。\n- 一旦误加载恶意模型，攻击者可直接获得服务器最高权限，导致整个训练环境被植入后门或勒索软件。\n- 缺乏运行时防护机制，无法在模型加载的瞬间自动拦截危险操作，防御完全滞后于攻击。\n\n### 使用 fickling 后\n- 通过 `activate_safe_ml_environment` 自动激活白名单机制，仅允许安全的机器学习库导入，从源头阻断非法代码执行。\n- 利用静态分析功能快速反编译并可视化 pickle 字节码，让隐藏的恶意逻辑无所遁形，审计效率提升数倍。\n- 集成 `always_check_safety` 后，任何尝试加载包含可疑指令的文件都会立即抛出 `UnsafeFileError` 异常，实现毫秒级拦截。\n- 支持自定义可信导入列表，在确保核心安全的前提下，灵活适配团队特定的业务依赖，兼顾安全与开发效率。\n\nfickling 将被动的事后补救转变为主动的运行时免疫，为 AI 模型的供应链安全构建了坚实的防火墙。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Ftrailofbits_fickling_383d1176.png","trailofbits","Trail of Bits","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Ftrailofbits_ff7161a4.png","More code: binary lifters @lifting-bits, blockchain @crytic, forks @trail-of-forks ",null,"opensource@trailofbits.com","https:\u002F\u002Fwww.trailofbits.com","https:\u002F\u002Fgithub.com\u002Ftrailofbits",[82,86],{"name":83,"color":84,"percentage":85},"Python","#3572A5",99.6,{"name":87,"color":88,"percentage":89},"Makefile","#427819",0.4,618,69,"2026-04-07T09:18:34","LGPL-3.0",1,"","未说明",{"notes":98,"python":99,"dependencies":100},"该工具依赖极少。PyTorch 仅为可选依赖，仅在需要使用 PyTorch 相关功能（如 polyglot 模块）时才需安装。可通过 pip 或 uv 进行安装。","3.9 - 3.13",[101],"torch (可选，用于 pytorch 和 polyglot 模块)",[14],[104,105,106],"machine-learning","python","security","2026-03-27T02:49:30.150509","2026-04-11T00:41:48.421634",[110,115,120,125,130,135],{"id":111,"question_zh":112,"answer_zh":113,"source_url":114},28498,"Fickling 是否支持直接分析 PyTorch (.pt\u002F.ckpt) 或 TorchScript 序列化模型文件？","是的，Fickling 已扩展支持。PyTorch 标准模型格式和 TorchScript 序列化格式本质上是包含 pickle 文件的 ZIP 归档。早期版本直接运行可能会报错，但通过 PR #62 及后续更新，Fickling 现在能够处理这些文件格式。用户可以直接使用 Fickling 对 .pt 或 .ckpt 文件进行安全检查，无需手动解压。","https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fissues\u002F29",{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},28499,"为什么安装 Fickling 会强制依赖 PyTorch (torch)，能否将其设为可选依赖？","在早期版本（如 0.1.0）中，torch 是强制依赖项，这增加了构建时间且对不需要 PyTorch 功能的用户不友好。维护者已确认该问题，并计划在后续版本中将 torch 依赖设为可选。如果您暂时受此困扰，可以继续使用不包含该强制依赖的旧版本（如 0.0.8），或者关注最新发布的版本以获取修复。","https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fissues\u002F92",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},28500,"如何检测针对 Fickling 扫描器的拒绝服务 (DoS) 攻击（如膨胀攻击）？","某些恶意 pickle 文件（如利用 `dup` 指令或重复从 memo 获取字符串）会导致 Fickling 解析超时或内存耗尽。维护者建议：1. 在解析前检查是否存在数据膨胀迹象；2. Fickling 正在集成更早的检测机制来识别此类扩展攻击；3. 对于已知模式的攻击（如生成巨大列表），Fickling 会通过数据流分析标记无用计算或直接超时报错，从而防止管道阻塞。","https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fissues\u002F111",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},28501,"如果一个文件中包含多个堆叠的 pickle 对象（常见于 ML 框架），Fickling 如何处理注入和检测？","某些 ML 框架（如 PyTorch 的旧版保存格式、NVIDIA Tacotron2 模型）会将多个 pickle 对象堆叠在一个文件中。早期 CLI 工具可能只处理第一个对象导致检测绕过或输出不完整。解决方案包括：1. 扫描时应遍历文件中的所有 pickle 对象，防止攻击者将恶意代码注入第二个及以后的对象来绕过检测；2. 在注入操作时，需要保留文件中剩余的字节并正确转储到输出文件中，以保持文件完整性。","https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fissues\u002F20",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},28502,"Fickling 生成的恶意注入代码是否会清理栈状态以避免被检测？","早期的注入逻辑如果在文件末尾注入代码，可能不会清理栈，导致栈上残留多余值（正常 pickle 执行后栈上应只剩一个最终对象指针），这容易被 `pickletools.dis` 或符号解释器检测到。该问题已在 PR #28 中修复：现在的注入代码会在末尾添加 `pop` 指令来清理栈，使其行为与正常 pickle 一致，从而提高隐蔽性。此外，新版本还包含数据流分析，可警告看似无用的计算。","https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fissues\u002F19",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},28503,"在使用 numpy 2.x 版本时运行 `test_polyglot.py` 测试失败怎么办？","该测试在某些环境下（如 nixpkgs 构建）可能会因 numpy 版本兼容性出现 `AttributeError` 或表现为不稳定（flaky）。维护者指出该测试本身存在不稳定性，并非每次都会失败。如果遇到错误，可以尝试多次运行测试，通常大部分运行会通过。如果持续失败，可能需要等待项目方针对 numpy 新版本的适配更新。","https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fissues\u002F162",[141,146,151,156,161,166,171,176,181,186,191,196,201,206,211,216,221,226,231],{"id":142,"version":143,"summary_zh":144,"released_at":145},189484,"v0.1.10","## 变更内容\n\n### 安全性\n\n- 扩展了不安全模块的黑名单，新增以下模块：\n  - `_frozen_importlib`、`_frozen_importlib_external`、`_imp`：用于阻止访问被屏蔽模块的引用（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002Fb9e690c5a57ee9cd341de947fc6151959f4ae359）\n  - `inspect`：用于阻止类似 `getattr` 的操作（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002F9a6d03fb74da5f37db8cf8ab6600bfb6679403eb）\n  - `linecache` 和 `difflib`：用于防止文件访问；`gc`：用于管理模块引用（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002F7f39d97258217ee2c21a1f5031d4a6d7343eb30d）。感谢 @fg0x0 的报告！\n  - `platform`：用于防止文件访问（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002F351ed4d4242b447c0ffd550bb66b40695f3f9975）。感谢 @mldangelo 的报告！\n\n### 通用\n\n* 各种来自 @dependabot 的更新（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F244、https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F245、https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F246）\n\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcompare\u002Fv0.1.9...v0.1.10","2026-03-13T16:33:51",{"id":147,"version":148,"summary_zh":149,"released_at":150},189485,"v0.1.9","## 变更内容\n\n### 安全性\n\n* 扩展了不安全模块黑名单，新增了 `uuid`、`_osx_support` 和 `_aix_support`（GHSA-5hwf-rc88-82xm）\n  * 已在 #240 中修复。感谢 @yash2998chhabria！\n* 修复了 `run_hook()`，以覆盖缺失的 pickle 入口点（GHSA-wccx-j62j-r448）\n  * 已在 #242 中修复。感谢 @mldangelo！\n\n### 通用\n\n* 多项 @dependabot 更新 (#238, #239)\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcompare\u002Fv0.1.8...v0.1.9","2026-03-03T23:31:42",{"id":152,"version":153,"summary_zh":154,"released_at":155},189486,"v0.1.8","# 变更内容\n\n## 重大变更\n\n- 停止对 Python 3.9 的支持，最低版本要求提升至 3.10，并开始支持 3.14（#175）\n- CLI 退出码现遵循 ClamAV 规范：0 表示无害，1 表示不安全，2 表示错误（#216）\n- 格式错误的 pickle 文件会抛出 `InterpretationError` 而非 `ValueError`（#207）\n- 我们在不安全导入黑名单中新增了多个模块（#210、#215、#217、#233、#236），同时努力减少对内置模块的误报（#206）\n\n## 安全性\n\n- 修复了一个通过 `OBJ` 实现的通用绕过漏洞（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fsecurity\u002Fadvisories\u002FGHSA-mxhj-88fx-4pcv）\n  - 该问题已在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F235 中修复。感谢 @yash2998chhabria！\n- 扩展了不安全导入黑名单，加入了更多相关模块（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fsecurity\u002Fadvisories\u002FGHSA-mhc9-48gj-9gp3）\n  - 该问题已在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F236 中修复。感谢 @yash2998chhabria！\n- 进一步扩展黑名单以捕获出站网络连接（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fsecurity\u002Fadvisories\u002FGHSA-83pf-v6qq-pwmr）\n  - 该问题已在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F233 中修复。感谢 @NucleiAv！\n- 将近期发现的 PickleScan 绕过方法集成到不安全导入检测中（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F210）\n- 扩大危险导入黑名单以提高覆盖率（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F215）\n- 扩展针对机器学习领域的不安全导入检测功能（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F217）\n- 添加安全内置函数白名单以防止误报（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F206）\n- 修复 AST 循环递归导致的 DoS 漏洞（问题 #196）（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F213）\n\n## 通用改进\n\n- 新增 AGENTS.md 文件，包含漏洞报告指南（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F234）\n- 为模型扫描添加 7z 归档支持（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F220）\n- 实现对 EXT1、EXT2 和 EXT4 pickle 操作码的支持（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F172）\n- 修复 unsafe_imports 和 MLAllowlist 中对 ast.Import 的处理问题（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F209）\n- 修复格式错误的 pickle 文件导致的 ValueError 崩溃问题（问题 #188）（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F207）\n- 迁移到 ty 类型检查器并修复类型错误（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F208）\n- 将 numpy 最低版本提升至 2.2.6（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F201）\n- 将测试迁移至使用 BytesIO 和临时路径（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F181）\n- 解决测试中的 Zip 滑动漏洞问题（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F204）\n- 修复 TestPolyglotModule 中随机 ZIP 文件生成不稳定的问题（https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F179）\n- 各种 @dependabot[bot] 更新（#197、#199、#200、#202、#203、#214、#222、#223、#224、#225、#227、#228、#229、#230、#232）\n\n完整变更日志：https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcompare\u002Fv0.1.7...v0.1.8","2026-02-21T00:56:50",{"id":157,"version":158,"summary_zh":159,"released_at":160},189487,"v0.1.7","## 变更内容\n\n* 修复了 #195 中提到的近期安全报告\n    - 通过 `ctypes` 和 `pydoc` 的绕过漏洞（GHSA-5hvc-6wx8-mvv4）\n        - 已在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002Fb793563e60a5e039c5837b09d7f4f6b92e6040d1 中修复。感谢 @0x-Apollyon！\n    - 通过 `cProfile` 的绕过漏洞（GHSA-p523-jq9w-64x9）\n        - 已在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002Fdc8ae12966edee27a78fe05c5745171a2b138d43 中修复。感谢 @beneaththecode！\n    - 通过 `importlib`、`runpy`、`code` 和 `multiprocessing` 的绕过漏洞（GHSA-q5qq-mvfm-j35x）\n        - 已分别在以下提交中修复：https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002F9a2b3f89bd0598b528d62c10a64c1986fcb09f66、https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002Feb299b453342f1931c787bcb3bc33f3a03a173f9、https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002F29d5545e74b07766892c1f0461b801afccee4f91、https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002Fb793563e60a5e039c5837b09d7f4f6b92e6040d1、https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002Fb793563e60a5e039c5837b09d7f4f6b92e6040d1。感谢 @mldangelo！\n    - 通过 `runpy` 的绕过漏洞（GHSA-wfq2-52f7-7qvj）\n        - 已在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002F9a2b3f89bd0598b528d62c10a64c1986fcb09f66 中修复。感谢 @beneaththecode！\n    - 通过内置模块导入的绕过漏洞（GHSA-h4rm-mm56-xf63）\n        - 已在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcommit\u002F9f309ab834797f280cb5143a2f6f987579fa7cdf 中修复。感谢 @0x-Apollyon！\n* 各种来自 @dependabot[bot] 的更新，见 #183、#184、#185、#192、#193、#194\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcompare\u002Fv0.1.6...v0.1.7","2026-01-09T18:13:26",{"id":162,"version":163,"summary_zh":164,"released_at":165},189488,"v0.1.6","## 变更内容\n\n### 安全性\n\n* CVE-2025-67747 - 通过 `marshal.loads()` 和 `types.FunctionType()` 实现绕过 ([GHSA-565g-hwwr-4pp3](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fsecurity\u002Fadvisories\u002FGHSA-565g-hwwr-4pp3))。\n  * 感谢 @geo-lit、@ajohnston9 和 @0x00nier 的报告！\n* CVE-2025-67748 - 通过 `pty.spawn()` 实现绕过 ([GHSA-r7v6-mfhq-g3m2](https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fsecurity\u002Fadvisories\u002FGHSA-r7v6-mfhq-g3m2))。\n  * 感谢 @geo-lit、@ajohnston9、@0x00nier 和 @raghavverma-cpu 的报告！\n\n### 通用改进\n\n* 由 @dhalf 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F170 中修复，通过使用公共 API 解决 NumPy 2.3+ 的兼容性问题。\n* 由 @dhalf 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F174 中修复，通过挂钩 `pickle.Unpickler` 类来防止 PyTorch v1.3+ 的钩子绕过。\n* 由 @dhalf 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F173 中添加了 `fickling.loads()` 公共 API 函数。\n* 由 @dhalf 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F171 中修复了 `ast.unparse()` 在处理格式错误的 pickle 文件时崩溃的问题。\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcompare\u002Fv0.1.5...v0.1.6","2025-12-15T18:14:21",{"id":167,"version":168,"summary_zh":169,"released_at":170},189489,"v0.1.5","## 变更内容\n* 由 @Boyan-MILANOV 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F139 中处理安全分析期间的无效操作码\n* 修复 #86：由 @dguido 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F143 中更新 pytorch_poc.py，使其使用 fickling.pytorch 模块\n* 由 @dguido 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F144 中使用 uv 和 ruff 对构建系统进行现代化改造\n* 由 @Boyan-MILANOV 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F164 中修复 pickle 解析器\n* 由 @Boyan-MILANOV 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F165 中将版本号提升至 0.1.5","2025-11-18T05:03:57",{"id":172,"version":173,"summary_zh":174,"released_at":175},189490,"v0.1.4","## 变更内容\n* @Russell-Tran 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F88 中实现了在 insert_function_call_on_unpickled_object 中的代码编译功能。\n* @Boyan-MILANOV 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F107 中添加了注入已编译 Python 字节码的选项。\n* @jace0x21 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F103 中将 distutils 的使用替换为标准库中的列表。\n* @dependabot[bot] 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F109 中将 pypa\u002Fgh-action-pypi-publish 从 1.8.14 升级到 1.9.0。\n* @coldwaterq 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F105 中改进了 polyglot，使其能够进行递归检查，并检测 numpy。\n* @Boyan-MILANOV 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F112 中增加了对 Python 调用中列表参数的支持，并修复了整数编码错误。\n* @Boyan-MILANOV 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F118 中实现了恶意机器学习文件的检测。\n* @Boyan-MILANOV 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F120 中添加了 pickle 扫描基准测试代码。\n* @Boyan-MILANOV 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F121 中更新了 README.md。\n* benchmarking - 更新 check_content 以支持字节数据，由 @sbwilli3 完成，见 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F122。\n* @dependabot[bot] 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F119 中将 pypa\u002Fgh-action-pypi-publish 从 1.9.0 升级到 1.10.3。\n* @dependabot[bot] 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F113 中将 pypa\u002Fgh-action-pip-audit 从 1.0.8 升级到 1.1.0。\n* @dependabot[bot] 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F132 中将 pypa\u002Fgh-action-pypi-publish 从 1.10.3 升级到 1.12.4。\n* ci: 移除 gh-action-sigstore-python，由 @woodruffw 完成，见 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F133。\n* @sbwilli3 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F123 中更新了 requirements.txt，以支持 fickling.analysis.BadCalls。\n* @samalws-tob 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F127 中新增了 ml.py 条目。\n* chore: 支持 Python 3.13，并为 3.14 做准备，由 @woodruffw 完成，见 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F131。\n* @Boyan-MILANOV 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F136 中更新了基准测试。\n* @Boyan-MILANOV 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F137 中将版本号升级至 0.1.4。\n\n## 新贡献者\n* @Russell-Tran 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F88 中完成了首次贡献。\n* @jace0x21 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F103 中完成了首次贡献。\n* @coldwaterq 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F105 中完成了首次贡献。\n* @sbwilli3 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F122 中完成了首次贡献。\n* @samalws-tob 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F127 中完成了首次贡献。\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcompare\u002Fv0.1.3...v0.1.4","2025-07-07T13:15:50",{"id":177,"version":178,"summary_zh":179,"released_at":180},189491,"v0.1.3","## 变更内容\n* 将 Torch 设置为可选依赖，由 @suhacker1 在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F95 中完成\n* 由 @dependabot 将 pypa\u002Fgh-action-pypi-publish 从 1.8.11 升级至 1.8.14，在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F98 中完成\n* 由 @suhacker1 增加版本号，在 https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fpull\u002F100 中完成\n\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcompare\u002Fv0.1.2...v0.1.3","2024-03-26T19:24:48",{"id":182,"version":183,"summary_zh":184,"released_at":185},189492,"v0.1.2","## 变更内容\n* 在构建工作流中，为更新的 Python 版本提升版本号","2024-01-29T15:52:41",{"id":187,"version":188,"summary_zh":189,"released_at":190},189493,"v0.1.1","## 变更内容\n* 更新发布工作流中的 Python 版本","2024-01-29T15:45:30",{"id":192,"version":193,"summary_zh":194,"released_at":195},189494,"v0.1.0","## What's Changed\r\n* Remove `fickling.fickle.Pickled.check_safety()` in favor of `fickling.analysis.check_safety()`\r\n* Restore `fickling.pickle` with deprecation warning for legacy\r\n* Introduce the polyglot module with tests and examples \r\n* Refactor, refine, and add tests to the PyTorch module \r\n* Add an import hook, global function hook, and context manager for malicious file detection integrations\r\n* Refactor and add a JSON output format to the modular analysis API for usability \r\n* Update README and examples with new features \r\n* Include more injection methods and techniques \r\n* Add support for OBJ, BINSTRING, and POP_MARK opcodes \r\n* Bump pypa\u002Fgh-action-pypi-publish from 1.8.10 to 1.8.11 \r\n* Bump actions\u002Fsetup-python from 4 to 5 \r\n* Bump sigstore\u002Fgh-action-sigstore-python from 2.1.0 to 2.1.1 \r\n* Bump actions\u002Fupload-artifact from 3 to 4 \r\n* Bump actions\u002Fdownload-artifact from 3 to 4 \r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002Ftrailofbits\u002Ffickling\u002Fcompare\u002Fv0.0.8...v0.1.0","2024-01-26T21:10:58",{"id":197,"version":198,"summary_zh":199,"released_at":200},189495,"v0.0.8","Refactor: the `fickling.pickle` module is renamed to `fickling.fickle`. The `fickling.pickle` module still works, but is deprecated and will eventually be removed from Fickling.","2023-11-20T16:05:07",{"id":202,"version":203,"summary_zh":204,"released_at":205},189496,"v0.0.7","Adds a new API call to insert a function call into a pickle that operates on the last unpickled object.","2023-10-11T15:24:18",{"id":207,"version":208,"summary_zh":209,"released_at":210},189497,"v0.0.6","Adds a modular API for analyses and analysis results, permitting sorting and filtering results.","2023-05-24T21:13:16",{"id":212,"version":213,"summary_zh":214,"released_at":215},189498,"v0.0.5","- Adds static dataflow analysis\r\n- Improved unused variable detection checks\r\n- Improved opcode injection\r\n- Minor bugfixes in opcode encoding\r\n- Fixes a bug that can result in a dirty stack after opcode injection\r\n- Programmatic support for stacked pickle files\r\n- Improved handling and parsing of `__builtin__`s","2023-05-19T16:32:41",{"id":217,"version":218,"summary_zh":219,"released_at":220},189499,"v0.0.4","### Bugfix Release\r\nAdds a workaround for an issue with a third party dependency affecting Python 3.8 and earlier.\r\nAdds the `socket` module as an overtly unsafe import.","2022-09-07T16:00:26",{"id":222,"version":223,"summary_zh":224,"released_at":225},189500,"v0.0.3","Improvements to documentation and examples, as well as support for two additional pickling opcodes.","2022-01-11T13:56:26",{"id":227,"version":228,"summary_zh":229,"released_at":230},189501,"v0.0.2","Support for additional opcodes and minor bugfixes in AST generation.","2021-07-14T18:55:22",{"id":232,"version":233,"summary_zh":234,"released_at":235},189502,"v0.0.1","This is the initial public release of Fickling.","2021-03-08T19:51:25"]