fix: replace dynamic form code execution with declarative handlers - #6524
Open
ZH007-s wants to merge 1 commit into
Open
fix: replace dynamic form code execution with declarative handlers#6524ZH007-s wants to merge 1 commit into
ZH007-s wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
此 PR 做了什么 / 为什么需要它?
动态表单的触发器、校验规则和表格渲染此前会通过
new Function()、eval()执行配置中的 JavaScript 字符串,部分表格值还会通过v-html或innerHTML输出。这可能使不可信或错误持久化的配置在浏览器中执行代码,带来安全风险。
修改概要
request_action和response_type替代动态触发器脚本。validator: 'component'替代字符串形式的组件校验函数。default、concat、number格式化规则替代表格eval表达式。v-html和innerHTML渲染。__proto__、prototype、constructor作为触发器写入目标字段。请确认已完成以下事项:
已完成测试,并在需要时补充了覆盖。
npm run type-check改动文件定向 ESLint 检查
npm run build-onlynpm run build-only-chat动态表单行为断言:触发器、格式化、旧版子表单加载器和危险字段拦截
提交信息符合 Conventional Commits 规范。
已评估文档影响。
不需要新增用户文档;依赖任意脚本执行的旧动态表单配置将不再执行,这是本次安全修复的预期行为。