rails GitHub avatar

rails-forensics-CVE-2026-66066

rails

一套用于 Rails/Active Storage 应用的取证工具和方法,帮助判断是否受到 CVE-2026-66066(KindaRails2Shell)影响以及是否被利用,包含技能指南、参考文档和扫描器。

Stars

6

7 天增长

暂无数据

Fork 数

0

开放 Issue

0

开源协议

MIT

最近更新

2026-07-30

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它把安全公告之后难以回答的问题变成有序的调查流程:先确定暴露窗口,再寻找利用痕迹;检测器只需分段读取即可识别构造文件,扫描器可在生产环境运行,并有 37signals 真实调查背景。

适合谁使用

  • 使用 Active Storage 和 vips 的 Rails 团队
  • 需要判断是否被利用的安全工程师和事件响应人员
  • 希望理解攻击链与取证方法的开发者
  • 使用 AI 代理(如 Claude Code)执行结构化技能的运维人员

典型使用场景

  • 运行 kr2s-was-i-vulnerable,在修补后确定应用暴露的时间窗口
  • 怀疑被利用时运行 kr2s-was-i-exploited,生成书面取证分析
  • 使用 bin/kr2s_scan_active_storage_blobs.rb 扫描 Active Storage 对象存储,查找构造的 MAT 文件
  • 阅读 reference/the-attack.md 和 reference/the-investigation.md,理解攻击链路及为何会留下取证痕迹

项目优势

  • 攻击链和调查方法被逐步记录,并标出四个关键节点
  • 检测器只需读取前 128 字节即可分类,无需下载整个对象
  • 生产扫描器是已提交的单文件,无需构建步骤
  • 工具来自 37signals 真实调查,并能正确识别安全研究人员上传的测试文件

使用前须知

  • 仅覆盖 Active Storage + :vips 且保留 variant 记录的场景;其他交给 libvips 的上传路径需要单独排查
  • 扫描干净是强证据而非证明;分析模板包含必须填写的局限性部分
  • 技能依赖仓库内相对路径的共享参考文档,单独复制技能目录会失效;且调查需尽快进行,因为日志会过期、未附加的 blob 会被清理

README 快速开始

rails-forensics-CVE-2026-66066

Tooling and method for answering two questions about a Rails application and CVE-2026-66066, the Active Storage and libvips arbitrary file read known as KindaRails2Shell:

  1. Was I vulnerable, and for how long?
  2. Was I exploited, and if so, what left the building?

The advisory explains the vulnerability and names the patched versions. It does not tell you how to find out whether anyone used it against you. That question decides whether secret_key_base and everything it signs have to be rotated, and it is harder than it looks. The evidence is spread across your object store and three Active Storage tables, application logs expire long before the exposure window does, and a scheduled purge of unattached blobs destroys precisely the records the answer depends on.

If you are going to ask, ask soon. Every one of those is a clock that is already running.

This is a documentation and skill repository rather than a library. Nothing here is installed into your application. An agent reads it and works against your application checked out somewhere else, and the one script that runs in production is a single self-contained file you copy into a container.

The vulnerability in one paragraph

Rails decides a blob may be image-processed by reading a content_type column that a direct upload lets the client set without the bytes ever being examined. libvips then decides what the file actually is by sniffing magic bytes. A file whose first ten bytes claim MATLAB 5.0 is routed to libvips' MATLAB loader, which hands it to libmatio, which dispatches on a different byte range and finds MAT 7.3, which is HDF5. HDF5's External File List lets a dataset's bytes live in another file named by path and offset, so rendering the "image" reads an attacker-chosen file off the server and returns its contents as pixels. The same confusion, twice, at two layers that cannot see each other's fields.

reference/the-attack.md traces the whole call chain, from the inbound request to the point where libmatio opens the target file, with the four load-bearing junctions marked. reference/the-investigation.md then explains why the attack is investigable at all: it leaves three artifacts of increasing strength, and the strongest of them is the rendered variant, which holds the stolen bytes as pixel values in your own object store.

Start

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

deerwork-ai
精选
deerwork-ai GitHub avatar

deer-workflow

An open-source Dynamic Workflow runtime that combines deterministic TypeScript orchestration with replaceable Agent runtimes.

AI 与机器学习大语言模型
312
gavamedia
精选
gavamedia GitHub avatar

deltafin

Deltafin is a research project that runs the 2.8-trillion-parameter Mixture-of-Experts model Kimi K3 on a single Apple Silicon Mac (e.g., M1 Max with 64 GB) at about 16 seconds per token, using exact, reproducible inference with local or streaming expert loading.

AI 与机器学习大语言模型
304
7-e1even
精选
7-e1even GitHub avatar

learn-agent

A collection of notes on building coding agents, derived from the production development of the desktop agent Reina, with each mechanism simplified into a zero-dependency, single-file Node.js demo.

AI 与机器学习大语言模型
218