github / github/codeql

[python] The tuple (*) argument of a call cannot step to function parameter for the CommandInjectionCustomizations flow

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

描述

In Python, when passing the typle (*) argument to function parameters, the taint propagation chain breaks. As shown in the following code snippet, this issue occurs. Are there plans to support this scenario? How do i resolve this issue?
```python
from django.contrib.auth.decorators import login_required
from django.conf.urls import url
import os

def build_cmd(cmd: str):
cmd = cmd + "; touch aa"
print(cmd)
return cmd

@login_required
def GetOperateLog(request):
cmd = request.POST.get('cmd', None)
args = []
args.append(cmd)
cmd3 = build_cmd(*args)
os.system(cmd3)

urlpatterns = [
url(r'^GetOperateLog', GetOperateLog, name='GetOperateLog'),
]
```
This is the taint propagation flow.
Image

贡献指南

打开贡献指南

调研方向

Start by reproducing the provided Python example and reviewing CodeQL's Python taint propagation handling for starred arguments. The issue mentions no source files or tests; the work is done when the taint flow reaches os.system through build_cmd(*args), with a regression test covering the example.

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

评估

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

把新 issue 发到你的邮箱

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