procrastination diagram

new code paranoia

Inspired by Simon Willison's code to HTMLify user input, converting urls into links, I wrote a hundred lines of python today, intending to drop them into the comment system. Only problem is, having written it, I don't trust it. I know there are bugs in there, code being code. Because I don't know, specifically, what those bugs are, much less understand their implications, I am reluctant to actually deploy the code.

As it happens, my first feelings of mistrust are fading as time passes.. but I think I need to figure out whether this is because I'm deciding that the potential problems are not that great or because I've already distancing myself from the code while shoveling snow and playing Mario Kart.

Basically, you can class the potential problems thusly:

  1. Bugs that allow a malicious attacker to execute code of their choice on my system. (extremely unlikely)
  2. Bugs that allow a malicious attacker to cause viewer's browsers to execute code (javascript) on their system. (unlikely, I think)
  3. Bugs that produce ugly comments. (likely)

Certainly the issues are weighted towards the latter, but the first two issues are sufficiently serious or embarrassing that I think I need to let the issue simmer for a while.

I noticed there wasn't a test suite in the version of the module you showed me the other day; test suites, while not exhaustive, are at least good for instilling confidence...
Certainly the way it's put together (lots of little pieces)
lends itself to that approach; I haven't felt competent
enough to put together a test suite yet. The bugs are going
to be in the cases that I haven't thought of, rather than
the ones I have.
And really, I don't quite understand the malicious javascript
problem as well as I'd like to. Sadly, I'm not sure we know
anyone who does.
Creative Commons License
This work by Karl Ramm is licensed under a Creative Commons Attribution 3.0 United States License.