Friday, May 24, 2024

HMI - Human Machine Interface or Hacker Machine Interface - the vulnerability in the SCADA system - the entry of Rust...

Economic nuke on America - the Baltimore Bridge Collapse ...

Why we must upgrade our critical systems from legacy software which was not written keeping cyber attack in mind.

Watch...


In the early part of my software career, i worked on the Human Machine Interface (HMI) software of two different companies - Omron's NTWin and Mitsubishi's GOT.

As the Human Machine Interface or the HMI software used for SCADA were not written keeping cyber attacks on mind, they are just plain vulnerable to the hackers.

Within the various SCADA solutions, the HMI represents the clearest and most present target for attackers. The HMI acts as a centralised hub for managing critical infrastructure. If an attacker succeeds
in compromising the HMI, nearly anything can be done to the infrastructure itself, including causing physical damage to SCADA equipment. Even if attackers decide not to disrupt operations, they can still exploit the HMI to gather information about a system or disable alarms and notifications meant to alert operators of danger to SCADA equipment.

Read... Humans of Universe... Read...

Here is a document on the vulnerability of the HMI software.


And here we go - the sophisticate malware called Stuxnet - which was responsible for crippling Iranian nuclear plant...

Can't believe?

Watch how it targeted the SIEMENS PLC at a nuclear plant of Iran.



Stuxnet was crafted to exploit specific vulnerabilities in Windows and the Siemens software stack. The worm utilized multiple zero-day exploits in Windows and targeted Siemens Step7 software running on Windows systems to reprogram PLCs. Since Stuxnet's payload and propagation mechanisms were tailored to this environment, a system running Linux would inherently be immune to these specific exploits.

You know as most of the legacy HMI software were written using C++, the memory corruption is one of the most occurred vulnerability of the HMI software.



I, therefore, was just wondering about the suitability of usage of Rust instead of C++ for writing Human Machine Interface software as the former is designed to handle the memory corruption issue quite nicely.

And voila - my guess was correct...

Rust can be a compelling alternative to C++ for developing SCADA Human-Machine Interfaces (HMIs), especially considering the memory safety advantages Rust offers. Here are some key points on why Rust could be a better choice:

Memory Safety

Elimination of Common Vulnerabilities: 

Rust's design inherently prevents common memory-related issues such as buffer overflows, null pointer dereferencing, and use-after-free errors. These types of vulnerabilities are prevalent in systems programmed in C++.

Borrow Checker: 

Rust’s borrow checker enforces strict ownership and borrowing rules at compile-time, ensuring that memory safety issues are caught early in the development process, thereby reducing the risk of memory corruption in deployed systems.

Performance

Comparable to C++: Rust is designed to offer performance comparable to C and C++. It achieves this through zero-cost abstractions, meaning you can write high-level code without incurring a performance penalty.

Efficient Concurrency: Rust's concurrency model prevents data races at compile time, allowing for safe and efficient concurrent programming, which is crucial for the high reliability and performance required in SCADA systems.

Modern Language Features

Error Handling: Rust provides robust error handling mechanisms through its Result and Option types, promoting safer and more explicit error management compared to exceptions in C++.
Strong Type System: Rust’s strong and expressive type system helps catch more errors at compile time, reducing runtime bugs and improving overall code quality.

Ecosystem and Tooling

Growing Ecosystem: Rust’s ecosystem is rapidly growing, with many libraries and tools available for systems programming, networking, and interfacing with hardware, which are essential for SCADA systems.

Cargo: Rust’s package manager and build system, Cargo, simplifies dependency management, builds, and project organization, contributing to developer productivity and code maintainability.

Adoption and Community

Industry Adoption: While Rust is still relatively new compared to C++, it has been gaining traction in various industries, including embedded systems and safety-critical applications, demonstrating its suitability for high-reliability domains like SCADA.

Active Community: Rust has a vibrant and supportive community, which helps in quickly resolving issues, sharing best practices, and continuously improving the language and its ecosystem.

Challenges

Learning Curve: The main challenge in adopting Rust is its steep learning curve, especially for developers accustomed to C++. The concepts of ownership, borrowing, and lifetimes can take time to master.


In summary, Rust offers significant advantages in terms of memory safety, performance, and modern language features, making it a strong candidate for developing SCADA HMIs. Its ability to prevent common vulnerabilities associated with memory corruption makes it particularly appealing for the high-security requirements of SCADA systems.

And now as CrowdStrike hitting hard, the C++ memory exception is already in news.

Is null pointer exception the reason for CrowdStrike? see below...


Shall we move from C++ to Rust?