DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • How To Learn Cyber Security Step-by-Step
  • Python Variables Declaration
  • Ruby on Rails vs Python for Web Development
  • Linux Kernel vs. Memory Fragmentation (Part II)

Trending

  • Automatic Code Transformation With OpenRewrite
  • Testing SingleStore's MCP Server
  • A Developer's Guide to Mastering Agentic AI: From Theory to Practice
  • The Human Side of Logs: What Unstructured Data Is Trying to Tell You
  1. DZone
  2. Software Design and Architecture
  3. Security
  4. Is Your Roadmap Prioritizing Memory-Safe Programming Languages?

Is Your Roadmap Prioritizing Memory-Safe Programming Languages?

Cybersecurity agencies around the world put out a plea for developers to use memory-safe programming languages. Is your roadmap ready?

By 
Greg Bulmash user avatar
Greg Bulmash
·
Apr. 24, 24 · Opinion
Likes (1)
Comment
Save
Tweet
Share
1.3K Views

Join the DZone community and get the full member experience.

Join For Free

In December of last year, cybersecurity agencies from multiple nations (USA, UK, CA, AU, and NZ) collectively put out a document called "The Case for Memory Safe Roadmaps." While memory-safe programming languages are not my normal topic of discussion, it's an important security issue and should be understood.

First, a quick explanation of memory safe vs. memory unsafe programming languages. In memory-unsafe languages, the developer is responsible for manually allocating and deallocating memory, which can lead to leaks, dangling pointers, and other bugs. And without automated bounds checking, they're more vulnerable to buffer overflows and other exploits.

Operating systems, device drivers, embedded software, and more are often written in C++ to give the developers very precise control, get "close to the metal," and operate as fast and lean as possible. 

Memory-safe languages include some of the most popular programming languages in the world: Python, Java, C#, Go, Rust, and Swift. JavaScript, which powers most websites on the front end and is used as a back-end language using Node.js, is a mixed bag when you ask about memory safety. It depends on the runtime engine and environment. Especially in the browser, there are ways to create memory leaks with bad management of DOM objects.

Given the speed and tuning abilities of a language like C++, why are all these security agencies recommending moving away from it?

Memory Issues Are a Major Area of Vulnerability

That may seem like restating the obvious, but two-thirds of vulnerabilities identified for memory-unsafe languages are related to memory issues. This can be found in a blog from the USA Cybersecurity and Infrastructure Security Agency (CISA) that pleads for developers to adopt memory-safe programming languages.

In real-world numbers, they cite Microsoft stating that around 70% of their CVEs relate to memory issues. The same goes for Google with the Chromium project that underlies not just the Chrome browser, but Microsoft's Edge, Opera, and more. Mozilla, the developer of the Firefox browser, is quoted as stating that 94% of their critical/high-rated vulnerabilities were memory-related.

Memory-Safe Programming Languages Are More Than “Good Enough”

In 2022, the Linux Kernel officially began supporting kernel modules written in Rust. That's not minor. Linux runs on just about anything these days and is the base kernel for all Android devices, including smartphones, tablets, smart TVs, cars, etc. While a person who runs Linux on their laptop or server might not consider Android to be a Linux operating system because it lacks most of the utilities and features of a traditional distribution, the kernel is Linux.

Both Rust and Go have been engineered to provide nearly C++ speeds and the three are the subject of a lot of discussion around performance. While one may beat the others in a specific benchmark, when multiple benchmark tests are taken into account, it's a toss-up with no language winning all of them. That does not mean you should immediately dump C++ unconditionally, but it's important to understand why you need it and if it will be superior enough for your specific purposes to assume its risks.

HuggingFace's tokenizers AI library is written in Rust with bindings for both Python and JavaScript. Python is popular for AI because it's easy to learn. While developers are writing AI code in Python, thanks to libraries like tokenizers, Python is more like a supervisor assigning the hardest work to the hardest workers (the libraries), which allows for very high performance.

Should You Switch to a Memory-Safe Language?

If you're using C++ and are considering adjusting your roadmap to adopt a memory-safe language, you'll have to consider multiple factors:

  • Which language is best suited to your existing and planned projects
  • What tradeoffs you'll have to make
  • Whether to port existing projects to the new language or just use it for new modules and new projects
  • The cost of getting your developers up to speed on the new language
  • Providing your developers with the right productivity and security tools, such as software composition analysis (SCA) tools, that will help you validate the third-party dependencies you use from package managers like PyPi (Python) or NPM (Node.js)

Memory safety is an important consideration because the lack of it in languages like C++ is a big source of vulnerabilities. Continuing with memory-unsafe languages won't necessarily introduce new bugs, but it increases the likelihood they'll occur (or may already be there, but undiscovered). Memory-safe languages won't guarantee you write error-free code, but with less worrying about memory issues, you'll have more overhead to deal with other security concerns… like sprawling secrets.

Linux kernel Ruby (programming language) Memory (storage engine) Python (language) Vulnerability

Published at DZone with permission of Greg Bulmash. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • How To Learn Cyber Security Step-by-Step
  • Python Variables Declaration
  • Ruby on Rails vs Python for Web Development
  • Linux Kernel vs. Memory Fragmentation (Part II)

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!