gocsaf / csaf

Tools to download or provide CSAF (Common Security Advisory Framework) documents.
https://csaf.io
42 stars 25 forks source link

Dont use string comparison to rank labels. #393

Closed s-l-teichmann closed 1 year ago

s-l-teichmann commented 1 year ago

Bug: We used string comparison to rank tlp levels in the rolie label checker.

case label >= csaf.TLPLabelAmber: with label = csaf.TLPLabelWhite

is the same as case "WHITE" > "AMBER": which is obviously not intended.

Fix: Use the tlpLevel function on the labels before the comparison.