Software Security and Privacy
Software Security and Privacy
Reference Book:
Software Engineering, Ian Sommerville
10th / Global Edition, Chapter 8
Pearson Publishers
Why is Software Security? HeartBleed Bug
The Heartbleed Bug is a serious vulnerability in the
Ø Buffer overflow bug in OpenSSL popular OpenSSL cryptographic software library. This
weakness allows stealing the information protected,
cryptographic library under normal conditions, by the SSL/TLS encryption
used to secure the Internet. SSL/TLS provides
ü Allows attacker to read server communication security and privacy over the Internet for
applications such as web, email, instant messaging (IM)
private keys and some virtual private networks (VPNs).
Ø Mobile applications
Ø Software components
ü Libraries, e.g., STL, OpenSSL
ü Frameworks, e.g., Apache Thrift, Tensorflow
v Masquerading or spoofing: Impersonation of one entity by another. Delegation occurs when one entity authorizes
a second entity to perform functions on its behalf. Masquerading is a violation of security whereas delegation is not.
üPassive masquerading: does not attempt to authenticate the recipient but merely accesses it.
ü Active masquerading: Masquerader issues response to mislead the user about its identity.
v Repudiation of origin: A false denial that an entity sent (or created) something.
v Denial of receipt: a false denial that an entity received some information or message.
v Delay: a temporary inhibition of a service. This requires manipulation of system control structures, such as network
components or server components.
v Denial of Service (DoS): a long term inhibition of a service. This an infinite delay.
Software Security & Privacy 12
Security Attacks
• Virus: A malicious software which attaches to another
program to execute a specific unwanted function on a
computer.
Reconnaissance Attacks
Ø unauthorized discovery and mapping of systems,
services, or vulnerabilities.
Access Attacks
Ø exploit known vulnerabilities in authentication services,
Trust exploitation
Buffer Overflow occurs when the amount of data in the buffer exceeds its
storage capacity. That extra data overflows into adjacent memory locations
and corrupts or overwrites the data in those locations.
compromise
the availability
of a network,
host, or
application
Middleware
Database management
Infrastructure Level
Generic, shared applications (browsers, e--mail, etc)
Operating System
ü System management problems where the infrastructure is configured to resists the attacks.
• Application security:
ü concerned with the security of individual application systems or related groups of systems.
ü Software Engineering problem where the system is designed to resists the attacks.
• Operational security:
ü concerned with the secure operation and use of the organization’s systems.
v Backup
ü Backup policies should be implemented to ensure that you keep undamaged copies of
program and data files. These can then be restored after an attack
Exposure Possible loss or harm to a computing system. This can be loss or damage to data, or
can be a loss of time and effort if recovery is necessary after a security breach.
Threat Circumstances that have potential to cause loss or harm. You can think of these as a
system vulnerability that is subjected to an attack.
Vulnerability A weakness in a computer-based system that may be exploited to cause loss or harm.
Clinic staff log on to the Mentcare system using a username and password. The system
requires passwords to be at least eight letters long but allows any password to be set
without further checking. A criminal finds out that a well-paid sports star is receiving
treatment for mental health problems. He would like to gain illegal access to information
in this system so that he can blackmail the star.
By posing as a concerned relative and talking with the nurses in the mental health clinic,
he discovers how to access the system and personal information about the nurses and
their families. By checking name badges, he discovers the names of some of the people
allowed access. He then attempts to log on to the system by using these names and
systematically guessing possible passwords, such as the names of the nurses’ children.
Asset The records of each patient that is receiving or has received treatment.
Exposure Potential financial loss from future patients who do not seek treatment because they do
not trust the clinic to maintain their data. Financial loss from legal action by the sports
star. Loss of reputation.
Vulnerability A weak password system which makes it easy for users to set guessable passwords.
User ids that are the same as names.
Attack An impersonation of an authorized user.
Threat An unauthorized user will gain access to the system by guessing the credentials (login
name and password) of an authorized user.
Control A password checking system that disallows user passwords that are proper names or
words that are normally included in a dictionary.
Unregister
patient
Impersonate
receptionist
View patient
info.
Medical Intercept Attacker
receptionist transfer
Transfer data
Contact
patient
Description A receptionist may transfer data from the Mentcare system to a general patient
record database that is maintained by a health authority. The information
transferred may either be updated personal information (address, phone number,
etc.) or a summary of the patient’s diagnosis and treatment.
Comments The receptionist must have appropriate security permissions to access the patient
information and the PRS.
Requirements All communications between the client and the server must use the Secure Socket Layer
(SSL). The https protocol uses certificate based authentication and encryption.
Safeguards Exposure
Asset Valuation: Asset valuation is value assigned to an asset
based on several factors, including importance to the
organization, use in critical process, actual cost, and Which is Which is
mitigated by Risks
nonmonetary expenses/costs (such as time, attention,
productivity, and research and development).
The cyclical Relationship of risk
q If an asset has no value, there is no need to provide protection for it. It makes no elements
sense to spend $100,000 protecting an asset that is worth only $1,000. As a rule, the
annual costs of safeguards should not exceed the potential annual cost of asset value
loss.
Software Security & Privacy 41
Risk Assessment
Asset
identification
Threat Attack
identification assessment
Technology
choices
Design and
Design assets
requirements
changes
Threat Attack
identification assessment
Available
controls
• Distributing assets means that New York trading system London trading system
International International
• Each platform has separate
US funds data UK funds data
equity prices equity prices
HK trading
user accounts
is high history
Euro. equity data
history
Asian equity data
International International
Euro. funds data Asian funds data
equity prices equity prices
Availability Integrity
threats threats
SOFTWARE PRODUCT
PROGRAM
Example: Virus
Example: Distributed denial
of service attack DATA
Example: Ransomware
Confidentiality
threats
Request credentials
Provide credentials
Return authentication
token
Authentication
response
User Permissions
All Read
Staff Create, Edit
Resource Access
Sysadmin Delete
A
B User Permissions
All Execute
C
Sysadmin Create, Delete
D
User Permissions
...
Admin Create, Read, Edit
Teaching staff Read, Edit
Student Read
if student = student_id
if department = dept_id
Secret Secret
key key
Alice Bob
Alice Bob
• Asymmetric encryption, does not require
secret keys to be shared
• An asymmetric encryption scheme uses Bob’s public key Bob’s private key
different keys for encrypting and decrypting
messages dr5ts3TR9dt hTr34BbfsDy
x4ztmRsYY... 9r3g5HHt76...
• Each user has a public and a private key.
Messages may be encrypted using either key
but can only be decrypted using the other key encrypt decrypt
• SQL poisoning attacks are attacks on software products that use an SQL database
• They take advantage of a situation where a user input is used as part of an SQL
command
• A malicious user uses a form input field to input a fragment of SQL that allows
access to the database
• The form field is added to the SQL query, which is executed and returns the
information to the attacker
advertisements Victim
2.
Data delivered and malware
• Cookies may be stolen, which makes a session- script installed in victim’s browser
• Denial of service attacks are attacks on a software system that are intended to
make that system unavailable for normal use
• Distributed denial of service attacks (DDOS) are the most common
• These involve distributed computers, that have usually been hijacked as part of a botnet,
sending hundreds of thousands of requests for service to a web app. There are so many
requests that legitimate users are denied access
• Other types of denial of service attacks target application users
• User lockout attacks take advantage of a common authentication policy that locks out a user
after a number of failed authentication attempts. Their aim is to lock users out rather than
gain access and so deny service to these users
• Users often use their email as their login name so if an attacker has access to a database of
email addresses, they can try to login using these emails
• Brute force attacks are attacks on a web app, where the attacker has some
information, such as a valid login name, but not the password
• The attacker creates different passwords and tries to login with each of these. If the login
fails, they then try again with a different password
• Attackers may use a string generator that generates every possible combination of letters and
numbers and use these as passwords
• To speed up the process of password discovery, attackers take advantage of the fact that
many users choose easy-to-remember passwords. They start by trying passwords from the
published lists of the most common passwords
• Brute force attacks rely on users setting weak passwords
• You can circumvent them by insisting that users set long passwords that are not in a
dictionary or are common words
• If you are offering a product directly to consumers and you fail to conform to
privacy regulations, then you may be subject to legal action by product buyers or
by a data regulator. If your conformance is weaker than the protection offered by
data protection regulations in some countries, you won’t be able to sell your
product in these countries
• If your product is a business product, business customers require privacy
safeguards so that they are not put at risk of privacy violations and legal action by
users
• If personal information is leaked or misused, even if this is not seen as a violation
of privacy regulations, this can lead to serious reputational damage. Customers
may stop using your product because of this
• Secure storage
• You must maintain data securely so that it cannot be tampered with or disclosed to
unauthorized people
• Discovery and error correction
• You must allow users to find out what personal data that you store. You must provide a way
for users to correct errors in their personal data
• Location
• You must not store data in countries where weaker data protection laws apply unless there is
an explicit agreement that the stronger data protection rules will be upheld
• Experience-based testing
ü The system is reviewed and analysed against the types of attack that
are known to the validation team.
• Penetration testing
ü A team is established whose goal is to breach the security of the
system by simulating attacks on the system.
• Tool-based analysis
ü Various security tools such as password checkers are used to analyse
the system in operation.
• Formal verification
ü The system is verified against a formal security specification.