Secure Communication
Everyone knows that communication between IoT products and the cloud needs to be secure. There's even industry consensus that connections should be secured using TLS (Transport Layer Security). As long as you are using TLS, you are secure. Right? No. TLS has the potential to be secure, but it is the implementation of TLS in your product that actually makes it secure.
Because we have a secure foundation in JavaScript, we use that to build our TLS implementation. Implementing TLS involves a parsing several different data formats in addition to the protocol itself. An attacker can carefully craft malicious data that trigger vulnerabilities in native C implementations of TLS. But because of JavaScript's design, these attacks don't trigger vulnerabilities and the connection simply fails.
But it turns out that securing the TLS layer isn't enough. Because TLS is used as a secure transport layer for IoT application layer protocols include MQTT, HTTP, and WebSocket. If an attacker can't trigger a vulnerability in the TLS layer, they will go after higher layers. In the Moddable SDK, these protocols - HTTP, MQTT, and WebSocket - are also implemented in JavaScript, ensuring that they aren't vulnerable to parsing layers. In systems implemented in pure C, it is common to test the TLS layer for vulnerabilities but then pair it with an application protocol implementation that isn't tested for security vulnerabilities to the same degree.
Even that's not enough. The application protocols deliver data that is parsed by your product's code. A JSON payload, for example, can be crafted to trigger vulnerabilities. But because the our JSON parser is continuously tested for vulnerabilities, an attacker isn't going to find a way to initiate an attack. And if your product code does its own parsing in JavaScript, it won't be vulnerable to attacks using malicious data.
That's a lot of layers to get right. Just knowing to use TLS is the staring point. If attackers can't succeed at one layer, they will move to another. So they all need to be secure. And using embedded JavaScript is the most straightforward way to secure all of those layers in your IoT products.
Embedded JavaScript takes care of other details that can lead to security vulnerabilities. For example, there is no uninitialized data in JavaScript, making it impossible for a product to accidentally leak private user data to the network by forgetting to fully initialize a data buffer.