github / github/codeql

Flask ImmutableMultiDict type cannot be accurately determined when calling to_dict

未关闭
#19,902 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
question
主要语言
CodeQL
星标
10.1k
派生
2.1k
平均合并
2 天 15 小时
30 天内合并 PR
141

描述

In Flask, the ImmutableMultiDict type cannot be accurately determined when calling to_dict()

```
from flask import Flask, render_template, request, redirect, url_for

def post(self):
f = request.form
param = f.to_dict()
vv = param["vv"]
pp = "/test/%s" % (vv)
os.system(pp)
```

![Image](https://github.com/user-attachments/assets/2fb58e31-495b-4512-a9f8-9df2e600d595)

贡献指南

打开贡献指南

调研方向

从使用 request.form 和 to_dict() 的 Flask 示例开始,然后检查 CodeQL 对 Flask 的 ImmutableMultiDict 及其 to_dict() 返回类型的建模。确认报告中的类型解析行为,并找出相关的 CodeQL 测试;对于此案例,类型能够被准确确定即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
flask, python
领域
security
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。