Skip to content

Ch32. PathGuard 与开发仓库保护

两层路径安全防御 + isOwnDevRepo 开发环境保护。

本章概要

PathGuard 是 AutoSnippet 的文件系统安全层,防止路径遍历攻击和意外写入。isOwnDevRepo 检测机制进一步保护 AutoSnippet 自身的源码仓库不受运行时数据污染。

PathGuard 双层防御

Layer 1: 路径规范化

Layer 2: 白名单校验

isOwnDevRepo 保护机制

数据库重定向

Setup 拒绝

PathGuard 阻止

关键代码

小结

Released under the MIT License.