Skip to content

[http-client-python][bug]: use of xml.etree.ElementTree causing CWE-611 report #8083

@joekiller

Description

@joekiller

Describe the bug

As a user I want to use typespec generated clients that are free from CWE warnings.

Actual behavior

Client is getting CWE warnings due to insecure function use.

The clients are using xml.etree.ElementTree.fromstring which is considered insecure generating CWE-611 warnings.

The jinja templates literally are trying to ignore this problem by using # nosec tags.

Expected behavior

Clients would use defusedxml which is considered safe.

It would be best to use the safe package. At a minimum a statement regarding why this may be ignored would be helpful.

Reproduction

npm install -g @typespec/compiler
tsp --version
1.2.1
tsp init
... choose REST
... include python client emitter
// update tsp config.yaml to emit to emitter-output-dir: "{cwd}/clientpy"
tsp compile .
snyk code test

FireShot Capture 018 - PR Check - Snyk - [app.snyk.io].pdf

Details:

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingemitter:client:pythonIssue for the Python client emitter: @typespec/http-client-python

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions