Why Data Types Matter

How you handle data types may lead to a number of vulnerabilities or odd behavior attackers can abuse

Teri Radichel
Cloud Security

--

One of my post that may later become a book on Secure Code. Also one of my posts on Application Security.

Free Content on Jobs in Cybersecurity | Sign up for the Email List

You’ve probably already heard about data types if you’ve been programming for any length of time. But have you dug into the details? Why should you care about data types?

In some languages, you have to make sure you use the correct data type in your code when you declare a variable. Other languages will try to figure out the type of data you want to use when you instantiate a variable. Who cares what the data type is just let the programming language figure it out, right? Well, let’s take a look at how that might work out.

Problems with mismatched data types

Most programming languages include something called primitive data types. These data types are defined within the language itself. They have certain properties. For example an integer data type in Java must be a whole number between -2,147,483,648 to 2,147,483,647.

Let’s at data types in Java and C#. What do you notice about the data types in these two charts?

Java

https://www.w3schools.com/java/java_data_types.asp

--

--

Teri Radichel
Cloud Security

CEO 2nd Sight Lab | Penetration Testing & Assessments | AWS Hero | Masters of Infosec & Software Engineering | GSE 240 etc | IANS | SANS Difference Makers Award