# vue **Repository Path**: hotthink/vue ## Basic Information - **Project Name**: vue - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-06-12 - **Last Updated**: 2026-06-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Vue 2 — Self-maintained Security Fork > 这是基于 Vue 2.7.16(官方 EOL 最终版)的**自修复安全分支**,仅修复已披露的漏洞,**不引入功能改动**,不保证未来同步官方任何更新。 > 上游已 EOL: · 推荐新项目使用 [Vue 3](https://github.com/vuejs/core)。 ## 当前版本 `v2.7.16-security.1` 已修复的漏洞: | CVE | 类型 | 涉及 | 修复点 | | ---------------- | -------------- | ---------- | ------------------------------------------------------------------ | | CVE-2024-9506 | ReDoS | 模板编译器 | `src/compiler/parser/html-parser.ts` 给 `reStackedTag` 加 `^` 锚点 | | CVE-2024-6783 | XSS / 原型污染 | codegen | `class.ts` / `style.ts` / SSR `codegen.ts` 用 `hasOwn` 防御 | | 多项传递依赖 CVE | 多种 | 构建链 | `pnpm.overrides` + `pnpm patch` | `pnpm audit` 结果:仅剩 1 个 low(`elliptic`,上游无修复,无法消除)。 ## 业务项目接入(最简) 把 `package.json` `dependencies` 改成: ```jsonc { "dependencies": { "vue": "git+https://github.com/joygqz/vue.git#v2.7.16-security.1", "vue-template-compiler": "git+https://github.com/joygqz/vue.git#template-compiler-v2.7.16-security.1", "vue-server-renderer": "git+https://github.com/joygqz/vue.git#server-renderer-v2.7.16-security.1", "@vue/compiler-sfc": "git+https://github.com/joygqz/vue.git#compiler-sfc-v2.7.16-security.1" } } ``` 只装用得到的即可。`npm` / `pnpm` / `yarn` 通用,**无需 patch 或 override**。 验证: ```sh node -p "require('vue/package.json').version" # 2.7.16-security.1 ``` 参考 `demo-vue/`(webpack + `vue-loader@15` 集成示例)。 ## 仓库分支 / Tag 一览 | package | git tag | release 分支 | | ----------------------- | -------------------------------------- | --------------------------------------------- | | `vue` | `v2.7.16-security.1` | `release/2.7.16-security.1` | | `vue-template-compiler` | `template-compiler-v2.7.16-security.1` | `release/template-compiler-2.7.16-security.1` | | `vue-server-renderer` | `server-renderer-v2.7.16-security.1` | `release/server-renderer-2.7.16-security.1` | | `@vue/compiler-sfc` | `compiler-sfc-v2.7.16-security.1` | `release/compiler-sfc-2.7.16-security.1` | `main` 分支只用于源码开发;`release/*` 分支由 `pnpm run release:security` 生成,包含完整构建产物供业务方 git 直接安装。 --- ## 开发 / 构建 / 发布流程 ### 1. 准备开发环境 ```sh pnpm install # 含 pnpm.overrides + patchedDependencies ``` ### 2. 改源码 漏洞修复或其他改动均在 `main` 分支进行: ```sh git checkout main # 编辑 src/** 或 packages/** ``` ### 3. 构建 + 测试 ```sh pnpm run build # 主包 + 子包产物 pnpm run build:types # .d.ts pnpm run test:unit pnpm run test:ssr pnpm run test:sfc pnpm audit # 预期:仅剩 1 个 low(elliptic 无上游修复) ``` ### 4. 提交源码改动 ```sh git add -A && git commit -m "fix: " && git push ``` ### 5. 跑发布脚本 ```sh pnpm run release:security # 等价于:node scripts/release-security.js ``` 脚本自动:算 N → 构建 → 主包发 `release/2.7.16-security.` + tag → 3 个子包各发一个孤儿分支 + tag → push → 打印本轮接入示例。 常用选项: | 选项 | 说明 | | ------------------- | ------------------------------------- | | `--n 5` | 手动指定本轮 N(默认远端最大值 +1) | | `--no-push` | 仅本地建分支/tag,最后打印 push 命令 | | `--no-build` | 跳过构建(产物已就绪) | | `--clean --n 2` | 清理 N=2 的本地残留 tag/分支/worktree | | `--remote upstream` | 远端名(默认 `origin`) | 跑 `node scripts/release-security.js --help` 看完整说明。中途失败时脚本会提示残留 ref 的自查命令。 ### 6. 通知业务项目 把新 tag 告知依赖方,业务项目把 `git+...#v2.7.16-security.<旧 N>` 改成新 tag 后 `pnpm install` 即可。 --- ## 仓库结构 - `src/` — Vue 运行时与编译器源码(漏洞修复在此) - `packages/` — 子包源码(`server-renderer` / `compiler-sfc` / `template-compiler`) - `scripts/` — 构建配置与发布脚本(核心:`release-security.js`) - `patches/` — `pnpm patch` 文件 - `demo-vue/` — webpack 集成 demo(验证可安装) ## License MIT(沿用原作者 Yuxi (Evan) You 的授权)

Vue logo