by api · 10y ago · 0 comments
http://www.nytimes.com/interactive/2015/07/03/upshot/a-quick...
You're totally right that you should have a unit test that verifies failure with invalid credentials, not just success with valid credentials. But a lot of programmers are not as smart as you are here!
> verifies that known invalid credentials don't permit access
you need a second test: "use invalid credentials, then try to download file, expect failure", i.e. a sequence of actions in a single test.
That test is evidently missing from my heating system's web interface, which has exactly this problem. There's a box to type in a PIN code, and it lets you proceed / retry correctly. But it's not necessary to bother with this, you can change the temperature without authenticating if you know the URL.
I actually uncovered a bug in a JWT library once when I wrote a test for my application to verify that an invalid token would be rejected.
Let's just say there was no corresponding test in the libraries test suite.
I'm not an embedded engineer type, so the security burden I saw being hefted upon my shoulders felt much more onerous than the typical REST type API I've been accustomed to.
At this point, I cannot imagine writing an app using IoT while at the same time feeling confident in understanding every bad security use-case.
Perhaps `IoT Security Expert` is an up-and-coming career path, but it's not a job description for the faint of heart nor for the one-off developer to be able to approach with any sense of confidence.