Skip to content

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

Open
@hyperlyz

Description

@hyperlyz

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?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions