intelmq icon indicating copy to clipboard operation
intelmq copied to clipboard

Sieve bot: comparision values are not sanitized leading to unexpected behavior

Open ghost opened this issue 4 years ago • 0 comments

If you write:

if source.asn == '64496'

it will never match. You need to write:

if source.asn == 64496

as "64496" == 64496) equals to false in Python. This is not JavaScript :)

To fix this, the sieve bot could sanitize the comparison value. In this example, "64496" results in an integer then, and the comparison succeeds.

ghost avatar Mar 30 '21 19:03 ghost