Skip to content

False positive - when json.Marshal output is used - cant result in "Potentially unsafe quoting" #14159

Open
@davidhadas

Description

@davidhadas

Description of the false positive

An output of golang json.Marshal is apparently not at risk for unsafe quoting

Code samples or links to source code

...
learned, errMarshal := json.Marshal(guardianSpec.Learned)
...
str := fmt.Sprintf(`[{"op":"replace","path":"/spec/learned","value":%s},{"op":"replace","path":"/spec/samples","value":%d}]`, learned, guardianSpec.NumSamples)
...

URL to the alert on GitHub code scanning (optional)
knative-extensions/security-guard#236

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions