3 ms·
> Yes, you could, but not verifying input usually isn't advisable. It's not not verifying input. It's just not verifying the types. There are no additional sec
by IshKebab 3y ago
> Yes, you could, but not verifying input usually isn't advisable.
It's not not verifying input. It's just not verifying the types. There are no additional security issues unless you do something spectacularly stupid.
For example you can load random bytes as a Protobuf file. It never validates that the data is in fact the right type, it just loads the bytes assuming they are. The only issue you'll see is junk data (or a parse error).
In any case I think you know that. I'm not really sure what point you were trying to make.
- skybrian 3y agoI'm not that clear about what point you're making either. We seem to talking past each other? The way I see it, types are sometimes used to represent security guarantees, so junk data getting cast to the wrong type could be a security hole. It depends on which types we're talking about. For example, you can declare a SafeHTML type whose underlying representation is a string, and if you somehow deserialize it without actually doing the runtime check, it could be a security bug. Verifying types and verifying input are closely related; the type keeps track of what you verified when you constructed an object of that type.