Rubber Duck Auditing

The rubber duck auditing method is as follows:

  1. Beg, borrow, steal, buy, fabricate or otherwise obtain a rubber duck (bathtub variety).
  2. Place rubber duck on desk and inform it you are just going to go over some code with it, if that’s all right.
  3. Explain to the duck what your code is supposed to do, and then go into detail and explain your code line by line.
  4. At some point you will tell the duck what security assumptions you’re making next and then realise that those assumptions don’t actually hold. The duck will sit there serenely, happy in the knowledge that it has helped you find a vulnerability.

Note: In a pinch a coworker might be able to substitute for the duck, however, it is often preferred to confide potential vulnerabilities to the duck instead of your coworker.

The Questions

For any piece of code you review—whether it’s a function, contract, file, variable, or struct—explain out loud to your duck:

Then, challenge your assumptions:

FAQs