Skip to content

Python: Can the data stream be passed across files? #4640

Description

@veno7998

Hello,

In codeql-python, I quoted the function of file1 in file2. In this case, can the data stream be passed?

file1: cmd.py

import subprocess
from subprocess import check_output
def exec_cmd(cmd):
    return subprocess.check_output(cmd)

file2:

import flask
import subprocess
from subprocess import check_output
from flask import request
from cmd import exec_cmd
app = flask.Flask(__name__)

@app.route('/index15')
def index15():
    tmp = request.args.get('c', 'ls')
    return exec_cmd(rmp)

Metadata

Metadata

Assignees

No one assigned

    Labels

    PythonquestionFurther information is requested

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions