Menu

112 CodeQL alerts on my python app, 14 were real

#python#redditpython#alerts#whether#times
Reading 0:00
15s threshold

HI, i run a long-lived python backend on windows and mac!

it only listens on 127.0.0.1 and almost every route needs an access token. last week i turned on the default CodeQL scan for the first time and got 112 alerts ( 112 → 1 critical, 87 high, 24 medium).

i went through them one by one with a single question: can this value come from text someone else wrote (a web page, a downloaded file, model output)? where an alert described an attack input, i actually fed it in and timed it.

the first one that surprised me was the regex that checks whether a downloaded file is html. `<!--` followed by `--><!--` 28 times kept it busy for 27 seconds. two more regexes that read text we didn't write did the same thing (22s and 11s). six alerts in that family were real. after the fix the html check runs 5,000 times in 0.003s.

the one i'm most embarrassed about: to see whether a login had finished, i checked whether the url contained the site name.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.