Skip to content

lxml guidance is not useful #767

@mwichmann

Description

@mwichmann

Describe the bug

Just so this is recorded somewhere, it's certainly not a show-stopper bug:

If your program uses lxml, it's going to get warnings like this:

>> Issue: [B410:blacklist] Using lxml to parse untrusted XML data is known to be vulnerable to XML attacks. Replace lxml with the equivalent defusedxml package.

Except that the defusedxml.lxml package was never really real, it was intended as an example, and to stop people from using it as-is it's now deprecated and planned for removal. Probably bandit should not be suggesting that? The problem is - what else would one suggest?

See: https://pypi.org/project/defusedxml/#defusedxml-lxml

Reproduction steps

Run bandit on something that uses lxml.

Expected behavior

Expect: "a useful suggestion". Possibly there's no good suggestion to make here?

Bandit version

1.7.0 (Default)

Python version

3.9 (Default)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions