W11 Security
W11 Security
Lecture 11
Content
■ Security Principles
■ Security Metrics
References
■ Security Engineering: A Guide to Building Dependable
Distributed Systems 2nd Edition, Ross J. Anderson, Wiley,
2008. https://www.cl.cam.ac.uk/~rja14/book.html
(3rd edition appeared in nov 2020)
■ Secure Software Design and Programming: Class Materials
by David A. Wheeler, George Mason University
https://dwheeler.com/secure-class/
■ https://inst.eecs.berkeley.edu/~cs161/fa18/lectures/
■ [RFC 1392] https://tools.ietf.org/html/rfc1392#appendix-C
■ Daniel Geer – Measuring Security tutorial
■ Common Vulnerability Scoring System (CVSS)
https://www.first.org/cvss/specification-document
Security principles
Source: “Improving Security Across the Software Development Lifecycle – Task Force Report”, April 1, 2004. http://www.cyberpartnership.org/init.html;
based on Gary McGraw 2004, IEEE Security and Privacy. Fair use asserted.
What do other organizations do?
BSIMM Survey
■ Building Security in Maturity Model (BSIMM)
– Study (survey) of software security initiatives of various
organizations
– Shows % of various activities among 109 organizations surveyed
– https://www.bsimm.com/
■ 4 domains (divided in 12 practices, divided into many activities)
– Governance: Practices that help organize, manage, and measure a
software security initiative
– Intelligence: Practices that result in collections of corporate
knowledge used in carrying out software security activities
– Secure Software Development Lifecycle (SSDL) Touchpoints:
Practices associated with analysis and assurance of particular
software development artifacts and processes.
– Deployment: Practices that interface with traditional network
security and software maintenance organizations
Developing secure software requires more than design & code... but you need those fundamentals
Information Security Terminology
■ Algorithms
– One-time passwords
– Shared secret
– Public key cryptography
■ Hardware
One-time passwords
■ Password list – must use in order, can’t reuse
– Give user a list, cross off each one as used
■ Pros:
– Counters network eavesdropping, shoulder
surfing
– Cheap to implement; tiny state to store at
server
■ Cons:
– Harder to distribute list
– Compromise of list allows impersonation
– Users hate them (when implemented by hand)
Shared secret
■ User & server have shared secret
■ Authentication process:
– Server generates nonce (random number), sends to
client
– Client encrypts nonce with secret, sends back
– Server also encrypts, compares with client value
– If same, user must know the secret – ok!
■ Pros:
– Prevents network eavesdropping
■ Cons:
– If secret compromised, user can be impersonated
Public key cryptography
■ Use “public key cryptography”
– User has two numbers, “public key” & “private key”
– Server knows public key of users
■ Authentication process:
– Server generates/sends random nonce to client
– Client encrypts nonce with private key, sends back
– Server decrypts with public key, if match, ok!
■ Pros:
– Provides non-repudiation of client key
■ Cons:
– If user’s private key compromised, user can be
impersonated
Hardware devices
■ Challenge-response: Server sends number
(nonce), devices receives and generates response,
response sent back to server
– Could implement shared-secret or public key
■ Time-based challenge-response: Uses current time
to determine what to send to server
– Server and token have to have time
synchronized
■ Smartcards: Contains user credentials
– Better ones never yield credentials outside
card
Example: YubiKey
■ YubiKey: Physical device, plugs into USB port, pretends to
be (an additional) keyboard
■ User moves cursor to “password” position and presses
button on Yubikey
■ On Button press, generates and “types in” a one-time
password + ENTER
■ Server verifies; if verifies, that password can’t be reused
■ Internally works on shared-secret key with AES
■ Shared secret used to encrypt a “serial number” that‘s
incremented
■ Sources: http://lwn.net/Articles/409031/
http://yubico.com/products/yubikey/
Will passwords disappear soon?
Doubtful
■ “Hey, have you seen [insert thing here]? It's totally going to kill passwords!
No, it's not.”
– “Despite its many flaws, the one thing that the humble password has
going for it over technically superior alternatives is that everyone
understands how to use it. Everyone.”
– “If your [password-replacement] product is so awesome, have you
stopped to consider why no one is using it?” [Hunt]
■ “We evaluate two decades of proposals to replace text passwords… Our
comprehensive approach leads to key insights about the difficulty of
replacing passwords… no known scheme come[s] close to providing all
desired benefits: none even retains the full set of benefits that legacy
passwords already provide… many academic proposals have failed to gain
traction because researchers rarely consider a sufficiently wide range of
real-world constraints.”
■ They’ll be replaced someday, but it’s not as easy as you might think
Source: “Here's Why [Insert Thing Here] Is Not a Password Killer” by Troy Hunt, 2018-11-05,
https://www.troyhunt.com/heres-why-insert-thing-here-is-not-a-password-killer/
“The Quest to Replace Passwords: A Framework for Comparative Evaluation of Web Authentication Schemes”
by Joseph Bonneau et al, 2012 IEEE Symposium on Security and Privacy,
Authorization
■ Once you have user identity and authentication, you can
determine what they’re authorized to do
■ Discretionary Access Control
– Data has owner, owner decides who can do what
■ Mandatory Access Control
– Data has certain properties, some access rights
cannot be granted even by owner (e.g., classification)
■ Role Based Access Control (RBAC)
– Assigns users into roles (static or dynamic)
– Access granted to the role, not directly to the user
– Sometimes membership restrictions
Auditing/Accountability/Logging
■ Record system actions, esp. security-relevant ones (e.g., log
in)
■ Detect unusual activity that might signal attack or
exploitation
– So you can take action: Disconnect that connection,
take down system, prosecute, …
– May help recovery or preventing future exploitation (by
knowing what happened)
– Operational systems often send logs elsewhere
■ If system subverted, older log entries can’t be
changed
Defense-in-depth/breadth
Source: DoD Risk, Issue, and Opportunity Management Guide for Defense Acquisition Programs, January 2017,
http://www.acq.osd.mil/se/docs/2017-RIO.pdf
Assurance case (ISO/IEC 15026)
■ Assurance = Grounds for justified confidence that a claim
has been/will be achieved (but how communicate that?)
■ ISO/IEC 15026-2:2011 specifies defines structure &
contents of an assurance case
– Facilitates stakeholder communications, engineering
decisions
– Typically for claims such as safety & security
■ An assurance case includes:
– Claim(s): Top-level claim(s) for a property of a system or
product
– Arguments: Systematic argumentation justifying this
claim
– Evidence/assumptions: evidence & explicit
assumptions underlying argument
Structure of an assurance case
Claim
(Conclusions,
uncertainty)
Argument Justification of
Argument
Evidence Assumption
Sub-claim
System design counters or Most vulnerabilities are due to likely/ OTS/ System security
reduces impact of most common weaknesses (defect types), & platform is verification found no
vulnerabilities custom sw is unlikely to have them secure issues
Static Dynamic
All un- Compo- Identified All analysis analysis
trusted nents given Passwords developers results results
list of
inputs id’d limited stored as trained in ok ok
likely
and privilege, so salted likely
weak-
checked by break-ins hashes, not weaknesses
nesses …
strict less likely to clear text, so & how to All likely
white-lists have attacker avoid them weak-nesses All SQL
significant cannot easily
have specific statements
harm reuse them
Buffer overflows not counter- prepared
if acquired
possible in selected measures
programming language
Good assurance cases
■ Good assurance case makes it easy to determine “enough
has been done”
– Supports decisions (“we’ve done/did enough”)
■ Use powerful terms: “All” / “highest priority” / “most
important”
– Work to identify (& justify) “these are all the important
cases”
– Then show “we’ve addressed all important cases”
– Like testing, “create a graph & cover it”
■ “A list of stuff you did” is not very convincing; organize the
argument!
Basic measurement terminology
applied to defect detection tools
Analysis/tool report Report correct Report incorrect
http://www.first.org/cvss/
Common Vulnerability
Assessment on Computer System
■ Base: intrinsic and fundamental characteristics of
a vulnerability that are constant over time and
user environments,
■ Temporal: characteristics of a vulnerability that
change over time but not among user
environments
■ Environmental: characteristics of a vulnerability
that are relevant and unique to a particular user's
environment
http://www.first.org/cvss/
Base
Metrics
■ Exploitability Metrics
– reflect the characteristics of the thing that is
vulnerable
– when scoring Base metrics, it should be
assumed that the attacker has advanced
knowledge of the weaknesses of the target
system, including general configuration and
default defense mechanisms (e.g., built-in
firewalls, rate limits, traffic policing).
Attack
Vector
Adjacent (A) The vulnerable component is bound to the network stack, but the attack is limited at the protocol level to a logically
adjacent topology. This can mean an attack must be launched from the same shared physical (e.g., Bluetooth or
IEEE 802.11) or logical (e.g., local IP subnet) network, or from within a secure or otherwise limited administrative
domain (e.g., MPLS, secure VPN to an administrative network zone). One example of an Adjacent attack would be
an ARP (IPv4) or neighbor discovery (IPv6) flood leading to a denial of service on the local LAN segment (e.g.,
CVE-2013-6014).
Local (L) •The vulnerable component is not bound to the network stack and the attacker’s path is via read/write/execute
capabilities. Either:the attacker exploits the vulnerability by accessing the target system locally (e.g., keyboard,
console), or remotely (e.g., SSH); or
•the attacker relies on User Interaction by another person to perform actions required to exploit the vulnerability
(e.g., using social engineering techniques to trick a legitimate user into opening a malicious document).
Physical (P) The attack requires the attacker to physically touch or manipulate the vulnerable component. Physical interaction
may be brief (e.g., evil maid attack[^1]) or persistent. An example of such an attack is a cold boot attack in which an
attacker gains access to disk encryption keys after physically accessing the target system. Other examples include
peripheral attacks via FireWire/USB Direct Memory Access (DMA).
Privileges
required
Metric Description
Value
None The attacker is unauthorized prior to attack, and therefore does not
(N) require any access to settings or files of the the vulnerable system
to carry out an attack.
Low (L) The attacker requires privileges that provide basic user capabilities
that could normally affect only settings and files owned by a user.
Alternatively, an attacker with Low privileges has the ability to
access only non-sensitive resources.
High (H) The attacker requires privileges that provide significant (e.g.,
administrative) control over the vulnerable component allowing
access to component-wide settings and files.
Impact
Metrics
Metric Description
Value
High (H) There is a total loss of confidentiality, resulting in all resources within the
impacted component being divulged to the attacker. Alternatively, access to
only some restricted information is obtained, but the disclosed information
presents a direct, serious impact. For example, an attacker steals the
administrator's password, or private encryption keys of a web server.
Low (L) There is some loss of confidentiality. Access to some restricted information
is obtained, but the attacker does not have control over what information is
obtained, or the amount or kind of loss is limited. The information
disclosure does not cause a direct, serious loss to the impacted
component.
None (N) There is no loss of confidentiality within the impacted component.
Temporal
Metrics
■ measure
– the current state of exploit techniques or code
availability,
– the existence of any patches or workarounds,
– or the confidence in the description of a
vulnerability.
Exploit
Code
Maturity
Metric Value Description
Not Defined Assigning this value indicates there is insufficient information to choose one of the other values,
(X) and has no impact on the overall Temporal Score, i.e., it has the same effect on scoring as
assigning High.
High (H) Functional autonomous code exists, or no exploit is required (manual trigger) and details are
widely available. Exploit code works in every situation, or is actively being delivered via an
autonomous agent (such as a worm or virus). Network-connected systems are likely to encounter
scanning or exploitation attempts. Exploit development has reached the level of reliable, widely
available, easy-to-use automated tools.
Functional Functional exploit code is available. The code works in most situations where the vulnerability
(F) exists.
Proof-of- Proof-of-concept exploit code is available, or an attack demonstration is not practical for most
Concept (P) systems. The code or technique is not functional in all situations and may require substantial
modification by a skilled attacker.
Unproven No exploit code is available, or an exploit is theoretical.
(U)
Environmental
Metrics
Impact =
If Scope is Unchanged 6.42 × ISS
15
If Scope is Changed 7.52 × (ISS - 0.029) - 3.25 × (ISS - 0.02)
PrivilegesRequired × UserInteraction
BaseScore =
If Impact \<= 0 0, else
If Scope is Unchanged Roundup (Minimum [(Impact + Exploitability),
10])
If Scope is Changed Roundup (Minimum [1.08 × (Impact +
Exploitability), 10])
Temporal Metrics Equations
ModifiedImpact =
Adjacent 0.62
Local 0.55
Physical 0.2
Attack Complexity / Modified Attack Low 0.77
Complexity
High 0.44
Privileges Required / Modified Privileges None 0.85
Required
Low 0.62 (or 0.68 if Scope /
Modified Scope is
Changed)
High 0.27 (or 0.5 if Scope /
Modified Scope is
Changed)
User Interaction / Modified User Interaction None 0.85
Qualitative Severity Rating Scale
Rating CVSS Score
None 0.0
Low 0.1 - 3.9
Medium 4.0 - 6.9
High 7.0 - 8.9
Critical 9.0 - 10.0
Example MySQL Stored SQL Injection
■ Vulnerability
– A vulnerability in the MySQL Server database could allow a remote,
authenticated user to inject SQL code that runs with high privileges
on a remote MySQL Server database. A successful attack could
allow any data in the remote MySQL database to be read or
modified. The vulnerability occurs due to insufficient validation of
user-supplied data as it is replicated to remote MySQL Server
instances.
■ Attack
– An attacker requires an account on the target MySQL database with
the privilege to modify user-supplied identifiers, such as table
names. The account must be on a database which is configured to
replicate data to one or more remote MySQL databases. An attack
consists of logging in using the account and modifying an identifier
to a new value that contains a quote character and a fragment of
malicious SQL. This SQL will later be replicated to, and executed on,
one or more remote systems, as a highly privileged user. The
malicious SQL is injected into SQL statements in a way that
prevents the execution of arbitrary SQL statements.
CVSS
■ CVSS v3.1 Base Score: 6.4
Metric Value Comments
Attack Vector Network The attacker connects to the exploitable MySQL
database over a network.
Attack Complexity Low Replication must be enabled on the target database.
Following the guidance in Section 2.1.2 of the CVSS
v3.1, we assume the system is configured in this way.
Privileges Required Low The attacker requires an account with the ability to
change user-supplied identifiers, such as table
names. Basic users do not get this privilege by
default, but it is not considered a sufficiently trusted
privilege to warrant this metric being High.
User Interaction None No user interaction is required as replication happens
automatically.
Scope Changed The vulnerable component is the MySQL server
database that the attacker logs into to perform the
attack. The impacted component is a remote MySQL
server database (or databases) that this database
replicates to.
CVSS score continued
Metric Value Comments
Confidentiality Low The injected SQL runs with high privilege and can
access information the attacker should not have
access to. Although this runs on a remote database
(or databases), it may be possible to exfiltrate the
information as part of the SQL statement. The
malicious SQL is injected into SQL statements that
are part of the replication functionality, preventing the
attacker from executing arbitrary SQL statements.
Integrity Low The injected SQL runs with high privilege and can
modify information the attacker should not have
access to. The malicious SQL is injected into SQL
statements that are part of the replication
functionality, preventing the attacker from executing
arbitrary SQL statements.
Availability None Although injected code is run with high privilege, the
nature of this attack prevents arbitrary SQL
statements being run that could affect the availability
of MySQL databases.
Example VMware Guest to Host
Escape Vulnerability
■ Vulnerability
– Due to a flaw in the handler function for Remote Procedure Call (RPC)
commands, it is possible to manipulate data pointers within the Virtual
Machine Executable (VMX) process. This vulnerability may allow a user
in a Guest Virtual Machine to crash the VMX process resulting in a
Denial of Service (DoS) on the host or potentially execute code on the
host.
■ Attack
– A successful exploit requires an attacker to have access to a Guest
Virtual Machine (VM). The Guest VM needs to be configured to have
4GB or more of memory. The attacker would then have to construct a
specially crafted remote RPC call to exploit the VMX process.
– The VMX process runs in the VMkernel that is responsible for handling
input/output to devices that are not critical to performance. It is also
responsible for communicating with user interfaces, snapshot
managers, and remote console. Each virtual machine has its own VMX
process which interacts with the host processes via the VMkernel.
– The attacker can exploit the vulnerability to crash the VMX process
resulting in a DoS of the host or potentially execute code on the host
operating system.
CVSS
■ CVSS v3.1 Base Score: 9.9