Skip to content

The potential security vulnerability for the flag pre_dispatch in Parallel() class due to the eval() statement. #1128

@jimlinntu

Description

@jimlinntu

As the title shows, if you try to enter a statement in the flag pre_dispatch, it will run whatever you want to run.
This should present a potential security vulnerability.

def f():
    return 1
p = Parallel(n_jobs=3, pre_dispatch="sys.exit(0)")
p(delayed(f)() for i in range(10)) # this will cause the system to exit

pre_dispatch = eval(pre_dispatch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions