Making Sense of The Infinite

Unlocking Infinite Possibilities Through Curiosity

Does CISA Want to End C/C++?

In today’s increasingly interconnected world, the security of critical infrastructure has never been more important. With rising cybersecurity threats targeting national security, economic stability, and public health, it is crucial that software developers adopt best practices in building secure systems. One of the most pressing concerns highlighted by experts in the field is the use of memory-unsafe programming languages, particularly C and C++, for developing products that support critical infrastructure. The Cybersecurity and Infrastructure Security Agency (CISA) has raised alarms over the dangers posed by continuing to use these languages, urging manufacturers to adopt memory-safe languages or implement a roadmap to eliminate memory safety vulnerabilities in existing products. Request for Comment on Product Security Bad Practices Guidance

Memory safety vulnerabilities, such as buffer overflows, dangling pointers, and memory leaks, are common issues in memory-unsafe languages like C and C++. These weaknesses allow attackers to exploit the system by executing arbitrary code, corrupting data, or gaining unauthorized access to sensitive information. In the context of critical infrastructure, such vulnerabilities can lead to disastrous outcomes, from the disruption of essential services to catastrophic security breaches that compromise national security and public safety.

CISA’s recent guidance emphasizes that developing new product lines using memory-unsafe languages is inherently dangerous. These languages, while powerful, require the programmer to manually manage memory, a process that is prone to errors. With alternative memory-safe languages available, such as Rust, which automatically ensures memory safety through its unique ownership model, the risks associated with using C and C++ can be mitigated. Rust’s design prevents common issues like null pointer dereferencing and buffer overflows, offering a safer and more robust alternative for building secure systems.

The CISA document further asserts that manufacturers should take proactive steps to avoid introducing memory safety vulnerabilities in new products. They recommend that software developers transition to using memory-safe languages or hardware capabilities that inherently prevent such vulnerabilities. For existing products written in C or C++, CISA advises that manufacturers should publish a memory safety roadmap by January 1, 2026. This roadmap should outline the prioritized approach to eliminating memory safety flaws, particularly in critical components like network-facing code or cryptographic operations.

By following a memory safety roadmap, manufacturers can systematically reduce vulnerabilities, ensuring that products are more secure and less susceptible to exploitation. CISA’s emphasis on a memory safety roadmap underscores the urgency of addressing these vulnerabilities in existing products. Without such a plan, the risks to national security, economic stability, and public safety remain significantly elevated. The roadmap must demonstrate that the manufacturer is making a reasonable effort to prioritize the elimination of memory safety flaws in their products.

This guidance does not apply to products with an announced end-of-support date before January 1, 2030. However, for products that are still in use and under active development, the pressure to implement memory safety measures is clear. Manufacturers must show commitment to improving the security posture of their products and reducing vulnerabilities over time. This includes prioritizing code components that handle sensitive functions and implementing secure coding practices across all stages of development.

However, the recommendation to move away from memory-unsafe languages like C and C++ is likely to face strong opposition from many developers. C and C++ have long been considered some of the most powerful and versatile programming languages available. They provide developers with fine-grained control over hardware, memory, and system resources, making them indispensable for performance-critical applications such as operating systems, embedded systems, and high-performance computing. Many developers, particularly those with deep expertise in C/C++, may feel that these languages are irreplaceable due to their unparalleled performance and control.

C/C++ is often considered nearly omnipotent—capable of performing virtually any task, including functionalities that other higher-level languages simply cannot achieve. This versatility comes with a tradeoff, however, as C and C++ demand a high level of skill, discipline, and responsibility from developers. The power to manipulate memory directly and to control system resources offers unparalleled performance but also introduces significant risks, particularly when it comes to memory safety vulnerabilities. C/C++ developers must be deeply aware of these risks and take utmost care when writing their code. This level of responsibility is not for everyone, and mistakes can lead to severe consequences, but it’s precisely the reason why C and C++ are trusted for building the most performance-sensitive systems.

For C/C++ developers, the prospect of switching to a memory-safe language like Rust may seem unnecessary or even restrictive. C++ is seen by many as the language of choice for building high-performance, low-level systems, and its long-standing history and massive ecosystem make it an attractive option. The manual memory management model in C/C++ is often viewed as a necessary tool for optimizing performance, which is crucial for many applications, particularly in areas such as game development, real-time systems, and large-scale enterprise solutions. Consequently, C/C++ developers may strongly resist the shift towards memory-safe languages, arguing that the security issues associated with memory management can be mitigated through careful coding practices and robust testing.

For many software developers, migrating from C or C++ to a memory-safe language like Rust may seem like a daunting task. While the learning curve for Rust’s ownership and borrowing system, which ensures memory safety, might not be particularly steep for C/C++ developers—given that C++ is often considered one of the most complex languages—these developers may feel frustrated by Rust’s strict rules, which can seem limiting compared to the freedom of manual memory management in C/C++. However, the long-term benefits of using Rust far outweigh these initial frustrations. By adopting a memory-safe language, developers can avoid common security pitfalls, reduce the risk of costly vulnerabilities, and ultimately build more resilient systems.

Moreover, the transition to memory-safe languages is not just about security. It also represents a shift towards modern software development practices. Languages like Rust are designed to work seamlessly with modern toolchains and provide an improved developer experience with features like package management, testing frameworks, and documentation generation. These features make it easier to develop, test, and maintain software, helping developers avoid introducing errors that could lead to security issues.

In conclusion, the call from CISA to adopt memory-safe languages like Rust is both timely and necessary. As the cyber threat landscape continues to evolve, it is critical that developers prioritize the security of their systems, particularly when it comes to critical infrastructure. By embracing memory-safe languages and implementing robust memory safety roadmaps, manufacturers can significantly reduce the risk of vulnerabilities, protect sensitive data, and ensure the safety and stability of national infrastructure. The transition to more secure programming languages is not just a best practice—it is an essential step towards securing the future of our interconnected world.

That said, it is important to recognize the strong attachment many C/C++ developers have to their languages of choice. Despite the advantages of memory-safe languages, C/C++ continues to be a dominant force in software development, and the debate over their use is unlikely to subside soon. Ultimately, finding a balance between security and performance will be essential to the future of software development for critical infrastructure.

Last revised on

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *