Hiawatha
A secure and advanced webserver

Hiawatha weblog

Security audit

27 April 2010, 08:45

A Hiawatha user has performed a security audit on the Hiawatha source code. In his opinion, 'Hiawatha seems to be doing a great job as far as secure coding'. So, that's something to be proud of. Nevertheless, there were several findings.

Many of those findings concern the usage of strcpy(). I don't agree with the security auditor that it's better to replace all strcpy()'s with strncpy() or strlcpy(). Those functions need the length of the destination buffer as a parameter. If you already know the length of the destination buffer, you can check if the source string will fit in the destination buffer. If it won't fit, you shouldn't start copying, unless you have a good reason to truncate the source string. In my opinion, the best way to safely copy strings is to make sure there is enough space in the destination buffer. Which is what I do throughout the entire Hiawatha code.

Other findings were two array indexing issues and a few memory leaks. All of them would only occur in exceptional situations, so there's nothing to worry about for the current version of Hiawatha. Nevertheless, even a very small security bug is still a security bug, so they have been fixed. Those fixes will be available in Hiawatha 7.3.

I will contact the security auditor and see what more he's willing to do to further improve Hiawatha's security.

Tags: security
by Hugo Leisink
Rew
29 April 2010, 23:30
Good job.
This article really made me moving the webserver to hiawatha on my server.
Thanks for developing the best webserver
Mike Van Der Geer
11 August 2010, 08:34
Good that you let people test Hiawatha, but who is "Hiawatha user" ?
I'm playing devil's advocate here, but why should anyone *trust* what "Hiawatha user" claims ?
Hugo Leisink
11 August 2010, 09:45
'Hiawatha user' is someone who wished to remain anonymous. Nobody tells you that you should trust what 'Hiawatha user' claims. Also, nobody tells you to trust what I'm saying about Hiawatha being secure. What I can tell you about 'Hiawatha user' is that he is in no way related to me or to Hiawatha. So, you could ask youself: "why should he be lying?". And remember that security is mainly based on trust.
Name: