Introduction to Engineering Secure Software
Fundamental Definitions of IT and Software Security
Secure Software: Engineering software such that it continues to function correctly even under malicious (intended) attacks. This perspective emphasizes resilience and the maintenance of correct operations despite adversarial attempts to subvert the system.
IT Security (Information Technology Security): The primary objective is to control access of subjects to objects using a reference model. This discipline was formally detailed in documentation dated December 1985.
The CIA Triad (Protection Services): These three pillars, defined by Bishop in 2003, constitute the core of information security:
Confidentiality: Refers to the concealment of information or resources to ensure they are not disclosed to unauthorized parties.
Integrity: Refers to the prevention of unauthorized changes to information or resources, ensuring data remains accurate and trustworthy.
Availability: Refers to the ability for authorized users to access and use information or resources when desired.
The Basic Security Model
Asset: A system resource, encompassing both data and software, that holds value for stakeholders. Security is fundamentally about protecting these assets from malicious, intended behaviors.
Policy: A set of requirements that explicitly defines what actions are allowed and what actions are prohibited within a system.
Threat: Any event that has the potential to violate a security policy.
Vulnerability: A specific weakness in a system or software that makes it possible for a threat to be realized.
Attack: The actual action of exercising a threat by specifically exploiting one or more related vulnerabilities.
Historical Case Study: Allan Scherr and the First Computer Troll
Context: In 1962, at the Massachusetts Institute of Technology (MIT), computer passwords were pioneered to provide privacy on shared machines.
The Incident: Allan Scherr, a student frustrated by a daily time limit of hours on the machines, developed a technical workaround. Using a punch card trick, he extracted all passwords from the computer system.
Consequences: Scherr exploited this access to exceed his allotted time and shared the stolen passwords with friends. This group eventually hacked into a teacher's account and left mocking messages, marking the start of the "computer troll" era. This incident is recognized as one of the earliest examples of cyber hacking and demonstrated the unforeseen consequences of early attempts at digital privacy.
Case Studies in Data and Software Integrity
Case 1: Data Broker Ecosystem: Data producers generate information that is collected and distributed by data brokers to various data consumers. The security and privacy of this pipeline are critical to maintaining the value and confidentiality of the assets.
Case 2: TrueCrypt Analysis: A security analysis of the encryption software TrueCrypt was conducted by the Federal Office for Information Security on November 16, 2015. This study scrutinized the software for potential weaknesses or mishandling of errors in its encryption routines.
Common Protection Features
Authentication: A feature designed to restrict access to an asset to only those users who comply with the established policy. Practical examples include the use of hardware like the ACR83 Pin-easy smart card reader.
Encryption: The process of encoding information so that only authorized parties can access it. This protects plaintext from being read by unauthorized entities. Examples include the use of TLS (Transport Layer Security) in network communication.
Packet Analysis of Secure Communication: In an analyzed TLSv1 exchange (captured via Wireshark 1.12.1), the following specifics were observed:
Source Port:
Destination Port:
TCP Flags: (PSH, ACK)
Calculated Window Size:
TLS Version: TLS 1.0 ()
Encrypted Application Data: A hexadecimal string such as
Limitations of Feature-Based Protection
Security cannot be achieved solely by adding features. Several limitations exist:
Implementation Errors: Features require correct implementation to be effective. For example, in TrueCrypt, if the
DecryptDataUnitsWorkfunction does not properly handle error return values fromDecryptDataUnitsCurrentThread, the security of the operation is compromised.Usage Errors: Features require correct use by the end-users and administrators.
Independency Assumptions: There is often a flawed assumption that different security features operate independently without negative interactions.
Language-Based Flaws: Features do not inherently account for vulnerabilities rooted in the programming language itself, such as memory management errors or logic flaws.
Examples of Insecure Software
SQL Injection: This occurs when malicious data is manipulated to change the logic of a database query. For example, if a query is structured as
SELECT * FROM users WHERE username = ' + variable + "';, an attacker could provide the inputa'; DROP TABLE employees;. The resulting execution would not only validate the user but also delete the employees table.Insecure Access Control: Systems may fail to enforce role-based restrictions. For instance, in an educational system with roles like Student, Teacher, Admin, and Head Teacher, an insecure policy might mistakenly allow an Admin to add report marks, a function that should be restricted to teachers.
Insecure Authentication - Microsoft Bob: A significant design flaw in Microsoft Bob allowed users who failed their password entry three times to simply create a new password. The software would state, "I see you have forgotten your password, please enter a new password," effectively bypassing the security of the original password.
Insecure Authentication - Smart TV Apps: Research by Niemietz et al. (2015) found that some Smart TV applications transmitted sensitive credentials directly in the URL of HTTP requests. An example URL contained parameters such as
ssoid=USERNAMEandssopw=PASSWORD, making them visible to anyone monitoring network traffic.Weak Randomness in Cyber-Physical Systems: Remote car hacking research demonstrated that insecure software might use predictable seeds for random number generation. In one instance, the software used
unsigned int t = time(NULL);wheretrepresented the number of seconds since the engine started. Because this value is predictable, the resulting password generated viarand()is also predictable.Aviation Control Systems: In 2015, the FBI seized a researcher's gear following reports that aviation control systems utilized insecure communications, highlighting vulnerabilities in critical infrastructure software.