Results of the 2015 Underhanded C Contest
underhanded-c.org
underhanded-c.org
Also, the author could claim they inspected/analyzed the visual output and the redaction appeared flawless.
At least, I assume most image viewers won't display a dialog:
Warning: suspiciously redundant image data detected. If any part of this image is supposed to be redacted, please contact your system administrator immediately.
In April 2020 I wrote a paper on some ideas on how to counter underhanded code. Some countermeasures seem promising, especially when combined. More info here: "Initial Analysis of Underhanded Source Code", April, 2020, IDA document: D-13166, https://www.ida.org/research-and-publications/publications/a...
I hope that some find it interesting, or even build on it.
It's the spec that is wrong. Obviously I mean the "replaces digits with zeros" spec, which does not follow the "doesn't leak data" spec.
The root problem is that "doesn't leak data" is hard to define in a way that can be formally verified. This is a fundamental problem, not an incidental one.
> doesn't leak data
This requirement was translated into "zero a rectangle" without considering every format. Careful analysis is clearly possible, it was done by the author of that code, but understanding the full implications of code is hard.
For example, not wanting to fudge around with allocation while iterating is palpable to anyone who can read C.
That contest winner probably squeaks by. But perhaps on the flip side, any memory allocation that takes place while looping over bytes gets flagged for further review? I don't have the numbers but it seems like a lot of security bugs in C have lived there.
Maybe the compiler blocks until you email it your pair programmer and they ACK back... :)
You know that the two examples you referenced are from 9 and then 16 years ago right? Is this an increasing problem or one from a previous age of software?
This is a legit question. I work with managed languages for web development. I’ve only looked at c/c++/assembly in high school classes
The Underhanded C Contest - https://news.ycombinator.com/item?id=29347859 - Nov 2021 (11 comments)
Results of the 2015 Underhanded C Contest - https://news.ycombinator.com/item?id=11032542 - Feb 2016 (47 comments)
Winners of the 7th Underhanded C Contest - https://news.ycombinator.com/item?id=9670785 - June 2015 (44 comments)
The 7th Underhanded C Contest is now Open - https://news.ycombinator.com/item?id=8550227 - Nov 2014 (3 comments)
I wonder if its JQ man:
Rust's macros and scopes are barely confusing enough, nothing like a text-based preprocessor. It lacks ifs with non-bracketed bodies, implicit integer/pointer conversions, goto, surprising operator precedence, silent ignoring of returned errors, and other quirks that make Underhanded contest work.