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.

(last updated Mon, 08 Dec 2003 07:44:22 UTC)
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...
posted by from 66.92.95.189 at Mon, 08 Dec 2003 20:26:23 UTC (updated Mon, 08 Dec 2003 07:44:22 UTC)
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.
posted by from 66.92.95.190 at Mon, 08 Dec 2003 21:03:12 UTC (updated Mon, 08 Dec 2003 07:44:22 UTC)
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.
posted by from 66.92.95.190 at Mon, 08 Dec 2003 21:15:16 UTC (updated Mon, 08 Dec 2003 07:44:22 UTC)
Comments are disabled on this entry.
Creative Commons License
This work is licensed under a Creative Commons License.