SlideShare a Scribd company logo
1 of 32
Misuse Cases – Security Requirements
From a Different Viewpoint
by
Greg Sternberg, CISSP, MSc
2
Bio
» Worked with computers for decades a long time
• Actually used punch cards a couple of times (and spilled once)
» Done just about everything with them
• Built them, programmed them, broke them, cursed them, …
» Work at Sungard Availability Services as a Security Architect
» Board member for ISSA, Denver, member of ISC(2), ISACA
» Speaker (obviously), author
» Certs: CISSP, CISM, TOGAF, MSc
» Affiliate Faculty at Regis College
3
Generic Requirements
4
» “Product ‘X’ must be secure
and protect the customer’s
data and the company’s IP.”
Just Right (?)
» “All data passing over the Internet or over insecure
network links must be encrypted, either at the
network layer (i.e. IPsec as used within VPNs), the
transport layer (i.e. SSL), or the application layer
(i.e. PGP mail). All network links that pass through
non-company owned buildings must be treated as
insecure. Only traffic contained within server
rooms or other well-controlled locations may be
excluded from the encryption requirement. FTP
must be replaced with SSH, HTTP with HTTPS, etc...
on all insecure links.”
5
Negative Requirements
» “Files containing the customer’s personal information shall
not be sent via FTP.”
• So email was used instead
» “All passwords shall be >8 characters, have at least 1
numeric digit, have at least one upper case character and 1
special character.”
• PASSWORD1!
» “Unauthorized users shall not be allowed to log onto the
system.”
• So a shared account (admin / Company01) was used
6
Misuse (What If?) Scenarios
» Not a new concept
• “Humans have analyzed negative scenarios
ever since they first sat around Ice Age
campfires debating the dangers of catching a
woolly rhinoceros. ‘What if it turns and
charges us before it falls into the pit?’”
» We do it all the time:
• Traffic
• Events
• Games
• Insurance
» Misuse vs. Abuse vs. Evil User Stories
7
Where To Start?
» Not a RIGHT way but plenty of right
ways
• User Story
• Use case
• UML diagram
• Requirements
» Not customer or user focused
» Don’t need to think like a hacker
» Won’t secure your system
8
A Web Service
» CRUD Order
» Ship Order
» Log in
» Log out
» CRUD User
9
General User
Admin User
Login
Ship Order
CRUD user
CRUD Order
Logout
<<extend>>
Web Service + Misuse
» Unauthorized
Address Change
» Falsify
Credentials
» Intercept
Communications
» Prevent
Legitimate
Access
10
General User
Admin User
Login
Ship Order
CRUD user
CRUD Order
Logout
Falisify Credentials
Malicious User
Intercept Communications
Unauthorized Address Change
Prevent Legitimate Access
Web Service + Misuse + Remediation
» 2-Factor
Authentication
» Lock Accounts
» Validate Entries
» Secure Transport
» Throttling
» Whitelisting
11
General User
Admin User
Login
Ship Order
CRUD user
CRUD Order
Logout
Falisify Credentials
Malicious User
Lock Account
Intercept Communications
Unauthorized Address Change
<<extend>>
2-Factor Authentication
<<extend>>
Secure Transport
<<extend>>
Validate Entries
<<extend>>
Prevent Legitimate Access
Throttling
Whitelisting
<<extend>>
<<extend>>
Prevent Legitimate Access
Name Prevent Legitimate Access
Goal(s) Disrupt the system so it can no longer take legitimate login requests. Distract the
administrators and security personal from the true goal of the hacker (i.e. system
penetration)
Actor(s) Hacker
Assumption(s) None
Precondition(s) There are externally facing access point(s) – i.e. URLs, APIs
Event Flow 1. A fake or spoofed login request is generated
2. Many login requests are sent to the system using the external access point
3. The number of these login requests exceeds the capacity of the system to handle
Alternate Flow(s) None
Post Condition(s)  Legitimate users are unable to access the system
 Applications (may) have abnormally stopped
 Network response times are unacceptable
 Application response times are unacceptable
 Administrators and security are distracted and not monitoring the system closely
Whitelisting
» As this application is only useable by internal
users, users who are connected to the
corporate VPN or customers who have
contracted to use it the firewall shall be
configured to only allow the CIDR of
X.X.X.X/20 or a customer provided CIDR.
Another Approach
» Attacker Scenario
• Who – Hostile, accidental, threats, auditors
• What – Assets, access, info
• Means - Threats
• Motive – Why do are they doing it?
• Opportunity - Vulnerabilities
14
When You Don’t Have A Single
Software Process
» Created a set of Agile OWASP Top 10 Misuse Stories
• They have some place to start
• They have a contact in security
• There’s a consistency (in security at least) across projects
• Focus more on elements that are unique to a project vs. the
basics
• Ties into ‘Software Security Assurance for the OWASP Top 10’
developer training
» “Why you Shouldn’t Use the OWASP Top 10 as a List of
Software Security Requirements.”
15
A1 Injection
» Injection flaws, such as SQL, OS, and LDAP injection occur when untrusted
data is sent to an interpreter as part of a command or query. The
attacker’s hostile data can trick the interpreter into executing unintended
commands or accessing data without proper authorization.
• As a [Specially Crafted Statement] I want to [take advantage of a lack of input
validation] so that [I can retrieve information I'm not entitled to]
• As a [Executable User Data] I want to [take advantage of a lack of data
validation] so that [I can retrieve information I'm not entitled to]
• As a [Editable Config File] I want to [take advantage of unvalidated
configuration data] so that [I can have the program behave in a manner
beneficial to me]
16
As a [Specially Crafted Statement] I want to [take advantage of a lack of input
validation] so that [I can retrieve information I'm not entitled to]
» For example, if we use this Java:
» user_name = request.getParameter (“UserName”);
» query= “SELECT * FROM Users WHERE UserName=“ + user_name;
» statement = connection.createStatement (query);
» and the user types in 'Aeinstein' the SQL statement would look like:
» SELECT * FROM Users WHERE UserName= 'Aeinstein';
» which would return just the record for 'Aeinstein'. However, if I were to type in
something a bit different:
» SELECT * FROM Users WHERE UserName='Aeinstein' or 1=1
» the database would end up translating the SQL statement to:
» SELECT * FROM Users WHERE TRUE
» Instead do the following:
» PreparedStatement ps = connection prepareStatement (query);
» ps.setString (1, username);
» result = ps.executeQuery ();
More Information
» Alexander, I. (1999). Misuse Cases Help to Elicit Non-Functional Requirements.
Retrieved from
http://www.scenarioplus.org.uk/papers/misuse_cases/misuse_cases.htm
» Alexander, I. Use/Misuse case analysis elicits non-functional requirements.
Computing & Control Engineering Journal, Vol 14, 1, pp 40-45, February 2003.
Retrieved from
http://www.scenarioplus.org.uk/papers/misuse_cases_hostile_intent/misuse_case
s_hostile_intent.htm
» Allenby, K. & Kelly, T. Deriving Safety Requirements Using Scenarios. Proc. 5th
International Symposium on Requirements Engineering RE'01, pp 228-235, 2001.
» Cockburn, A. (2001). Writing effective use cases. Addison-Wesley.
» Bird, Jim, Adding Appsec to Agile: Security Stories, Evil User Stories and Abuse(r)
Stories, https://dzone.com/articles/adding-appsec-agile-security
18
More Information
» McGraw, G. (Ed.). (2004). Misuse and Abuse Cases: Getting Past the Positive. IEEE
Security & Privacy 2004. Retrieved from
http://www.cigital.com/papers/download/bsi2-misuse.pdf
» OWASP, Agile Software Development: Don't Forget EVIL User Stories,
https://www.owasp.org/index.php/Agile_Software_Development:_Don%27t_Forg
et_EVIL_User_Stories
» SAFECode – http://www.safecode.org/
» Sindre, G. & Opdahl, A. (2001). Templates for Misuse Case Description. Proc. 7th
Intl Workshop on Requirements Engineering, Foundation for Software Quality
(REFSQ'2001), Interlaken, Switzerland, 4-5 June 2001
» Srivatanakul, T., Clark, J., & Polack, F. (2004). Writing Effective Security Abuse
Cases. University of York Technical Report YCS-2004-375
http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=976CD9803D704C0F2B
561C39C68519B1?doi=10.1.1.62.4125&rep=rep1&type=pdf
19
Questions?
20
» If you liked the presentation:
• gwstern@comcast.net
• @gsternbe
• https://www.linkedin.com/in/g
regsternberg
» Otherwise:
• gwstern@spam.net
• @_dev_null_
Supporting Slides
21
Requirement vs. Use Case vs. User Story
» Requirements
• Nonfunctional – describe how the system works
• Functional – describes what the system does
• What the system is supposed to do at a level which can be tested and verified
» Use Cases
• A (usually) detailed description of a set of interactions between a system and one or more
actors
• About the behavior to meet the needs
• Describe a complete interaction
» User Stories/Scenarios
• A short description of something the ‘customer’ wants to do focused on the result from doing
that thing
• About needs
• Easy to read
22
A2 – Broken Authentication and
Session Management
» Application functions related to authentication and session management are often
not implemented correctly, allowing attackers to compromise passwords, keys, or
session tokens, or to exploit other implementation flaws to assume other users’
identities.
• As a [Forever User Session] I want to [be able to reuse session information] so that [I can reuse
another user's session]
• As a [Unencrypted A/A Token] I want to [log in as someone I'm not] so that [I can have
unfettered access to the system]
• As a [Simple Password] I want to [be easily broken] so that [I can pretend to be another user]
• As a [Man In The Middle] I want to [pretend to be someone else] so that [I can trick the
system (or user) into treating me as someone I’m not]
• As a [Malicious User] I want to [find sessions that have not been closed] so that [I can pretend
to be that user]
23
A3 – Cross-Site Scripting / XSS
» XSS flaws occur whenever an application takes untrusted data and
sends it to a web browser without proper validation or escaping.
XSS allows attackers to execute scripts in the victim’s browser which
can hijack user sessions, deface web sites, or redirect the user to
malicious sites
• As a [Code In User Data] I want to [be executed] so that [I can have the
program behave in an undesired manner]
• As an [Malicious Client] I want to [send dangerous information to the
server] so that [I can have the server behave how I want]
• As an [Malicious Server] I want to [send dangerous information to the
client] so that [I can have the client behave how I want]
24
A4 – Insecure Direct Object References
» A direct object reference occurs when a developer exposes a reference to
an internal implementation object, such as a file, directory, or database
key. Without an access control check or other protection, attackers can
manipulate these references to access unauthorized data.
• As a [Everyone Has Access To Everything] I want to [access information] so that
[I can make copies of it for my personal use]
• As an [Editor of URL Strings] I want to [try different URLs] so that [I can map
out the directory hierarchy of the system]
• As an [Editor of URL Strings] I want to [try different URL parameters] so that [I
can alter the behavior of the system]
• As a [Malicious Keyboard] I want to [change url] so that [I can get access to a
different directory]
25
A5 – Security Misconfiguration
» Good security requires having a secure configuration defined and
deployed for the application, frameworks, application server, web
server, database server, and platform. Secure settings should be
defined, implemented, and maintained, as defaults are often
insecure. Additionally, software should be kept up to date.
• As a [User of the Internet] I want to [find default information and try
it] so that [I can gain access to systems]
• As a [Lazy Malicious Person] I want to [try to access systems using
existing backdoors] so that [I can steal data and control the system]
• As a [Unsecured File] I want to [be modified] so that [a malicious
attacker can change the system’s behavior]
26
A6 – Sensitive Data Exposure
» Many web applications do not properly protect sensitive data, such
as credit cards, tax IDs, and authentication credentials. Attackers
may steal or modify such weakly protected data to conduct credit
card fraud, identity theft, or other crimes. Sensitive data deserves
extra protection such as encryption at rest or in transit, as well as
special precautions when exchanged with the browser.
• As a [Reader of Caches] I want to [scan system and application caches]
so that [I can glean sensitive data or passwords]
• As a [Modifier of URLs] I want to [modify parameters] so that [I can
have the system give me things for free]
• As a [XML guru] I want to [modify XML parameters] so that [I can have
the system behave in a fashion beneficial to me]
27
A7 – Missing Function Level Access
Control
» Most web applications verify function level access rights before making
that functionality visible in the UI. However, applications need to perform
the same access control checks on the server when each function is
accessed. If requests are not verified, attackers will be able to forge
requests in order to access functionality without proper authorization.
• As a [Malicious Program] I want to [try different parameters] so that [I can
make the program behave in a fashion it is not supposed to]
• As a [Malicious Client] I want to [bypass client controls] so that [I can affect
the system]
• As a [Creator of RESTful calls] I want to [pretend to be a legitimate invocation]
so that [I can invoke methods I’m not otherwise allowed to invoke]
28
A8 – Cross-Site Request Forgery / CSRF
» A CSRF attack forces a logged-on victim’s browser to send a forged HTTP
request, including the victim’s session cookie and any other automatically
included authentication information, to a vulnerable web application. This
allows the attacker to force the victim’s browser to generate requests the
vulnerable application thinks are legitimate requests from the victim.
• As a [Malicious User] I want to [find sessions that have not been closed] so
that [I can pretend to be that user]
• As an [Unvalidated Action] I want to [trick the browser to sending an HTTP
request] so that [I can have it execute on behalf of the user, without their
knowing]
• As a [HTTP request With Side Effects] I want to [create a malicious side effect]
so that [I can have the user execute it for me using their credentials]
29
A9 – Using Known Vulnerable
Components
» Components, such as libraries, frameworks, and other software
modules, almost always run with full privileges. If a vulnerable
component is exploited, such an attack can facilitate serious data
loss or server takeover. Applications using components with known
vulnerabilities may undermine application defenses and enable a
range of possible attacks and impacts.
• As a [User of the Internet] I want to [try out known weaknesses] so
that [I can discover an unpatched vulnerability]
• As an [Unpatched System] I want to [present known weaknesses] so
that [I can make it easy to be compromised]
• As a [Third Party Library] I want to [run everything in the library with
elevated privileges] so that [I can bypass security controls]
30
A10 – Unvalidated Redirects and
Forwards
» Web applications frequently redirect and forward
users to other pages and websites, and use
untrusted data to determine the destination
pages. Without proper validation, attackers can
redirect victims to phishing or malware sites, or
use forwards to access unauthorized pages.
• As a [Malicious Keyboard] I want [modify the url] so
that [cause a user to visit a place of my choosing,
rather than theirs]
31
32

More Related Content

What's hot

Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Brian Huff
 
Securing Web Applications with Token Authentication
Securing Web Applications with Token AuthenticationSecuring Web Applications with Token Authentication
Securing Web Applications with Token AuthenticationStormpath
 
What are JSON Web Tokens and Why Should I Care?
What are JSON Web Tokens and Why Should I Care?What are JSON Web Tokens and Why Should I Care?
What are JSON Web Tokens and Why Should I Care?Derek Edwards
 
2013 OWASP Top 10
2013 OWASP Top 102013 OWASP Top 10
2013 OWASP Top 10bilcorry
 
Beyond the OWASP Top 10
Beyond the OWASP Top 10Beyond the OWASP Top 10
Beyond the OWASP Top 10iphonepentest
 
RSA Europe 2013 OWASP Training
RSA Europe 2013 OWASP TrainingRSA Europe 2013 OWASP Training
RSA Europe 2013 OWASP TrainingJim Manico
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013tmd800
 
Mr. desmond cloud security_format
Mr. desmond cloud security_formatMr. desmond cloud security_format
Mr. desmond cloud security_formatMULTIMATICS_ID
 
Reliable and fast security audits - The modern and offensive way-Mohan Gandhi
Reliable and fast security audits - The modern and offensive way-Mohan GandhiReliable and fast security audits - The modern and offensive way-Mohan Gandhi
Reliable and fast security audits - The modern and offensive way-Mohan Gandhibhumika2108
 
Securing Single Page Applications with Token Based Authentication
Securing Single Page Applications with Token Based AuthenticationSecuring Single Page Applications with Token Based Authentication
Securing Single Page Applications with Token Based AuthenticationStefan Achtsnit
 
Sql injections - with example
Sql injections - with exampleSql injections - with example
Sql injections - with examplePrateek Chauhan
 

What's hot (16)

Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)
 
Securing Web Applications with Token Authentication
Securing Web Applications with Token AuthenticationSecuring Web Applications with Token Authentication
Securing Web Applications with Token Authentication
 
What are JSON Web Tokens and Why Should I Care?
What are JSON Web Tokens and Why Should I Care?What are JSON Web Tokens and Why Should I Care?
What are JSON Web Tokens and Why Should I Care?
 
2013 OWASP Top 10
2013 OWASP Top 102013 OWASP Top 10
2013 OWASP Top 10
 
Owasp top 10 2013
Owasp top 10 2013Owasp top 10 2013
Owasp top 10 2013
 
Beyond the OWASP Top 10
Beyond the OWASP Top 10Beyond the OWASP Top 10
Beyond the OWASP Top 10
 
RSA Europe 2013 OWASP Training
RSA Europe 2013 OWASP TrainingRSA Europe 2013 OWASP Training
RSA Europe 2013 OWASP Training
 
Owasp first5 presentation
Owasp first5 presentationOwasp first5 presentation
Owasp first5 presentation
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013
 
Mr. desmond cloud security_format
Mr. desmond cloud security_formatMr. desmond cloud security_format
Mr. desmond cloud security_format
 
Owasp top 10
Owasp top 10Owasp top 10
Owasp top 10
 
Spring Security 3
Spring Security 3Spring Security 3
Spring Security 3
 
Reliable and fast security audits - The modern and offensive way-Mohan Gandhi
Reliable and fast security audits - The modern and offensive way-Mohan GandhiReliable and fast security audits - The modern and offensive way-Mohan Gandhi
Reliable and fast security audits - The modern and offensive way-Mohan Gandhi
 
Op2423922398
Op2423922398Op2423922398
Op2423922398
 
Securing Single Page Applications with Token Based Authentication
Securing Single Page Applications with Token Based AuthenticationSecuring Single Page Applications with Token Based Authentication
Securing Single Page Applications with Token Based Authentication
 
Sql injections - with example
Sql injections - with exampleSql injections - with example
Sql injections - with example
 

Viewers also liked

主日投影片
主日投影片主日投影片
主日投影片gaanchurch
 
Taller videocristianbejarnao
Taller videocristianbejarnaoTaller videocristianbejarnao
Taller videocristianbejarnaoDa Escudero
 
Updated cv brendan moses
Updated cv brendan mosesUpdated cv brendan moses
Updated cv brendan mosesbrendan moses
 
Does the value-added tax shift to consumption prices?
Does the value-added tax shift to consumption prices?Does the value-added tax shift to consumption prices?
Does the value-added tax shift to consumption prices?Palkansaajien tutkimuslaitos
 
Geografipresentasi 120309203311-phpapp01
Geografipresentasi 120309203311-phpapp01Geografipresentasi 120309203311-phpapp01
Geografipresentasi 120309203311-phpapp01matinikromi
 
Bullying power point
Bullying power pointBullying power point
Bullying power pointcmallo1234
 
Synthetic Identities and AML
Synthetic Identities and AMLSynthetic Identities and AML
Synthetic Identities and AMLdoylebc
 

Viewers also liked (12)

主日投影片
主日投影片主日投影片
主日投影片
 
Taller videocristianbejarnao
Taller videocristianbejarnaoTaller videocristianbejarnao
Taller videocristianbejarnao
 
Updated cv brendan moses
Updated cv brendan mosesUpdated cv brendan moses
Updated cv brendan moses
 
Does the value-added tax shift to consumption prices?
Does the value-added tax shift to consumption prices?Does the value-added tax shift to consumption prices?
Does the value-added tax shift to consumption prices?
 
GLC CV 15
GLC CV 15GLC CV 15
GLC CV 15
 
Razla ppt
Razla pptRazla ppt
Razla ppt
 
Geografipresentasi 120309203311-phpapp01
Geografipresentasi 120309203311-phpapp01Geografipresentasi 120309203311-phpapp01
Geografipresentasi 120309203311-phpapp01
 
Bullying power point
Bullying power pointBullying power point
Bullying power point
 
Competencias 2
Competencias 2Competencias 2
Competencias 2
 
Cv 2016 pdf
Cv 2016 pdfCv 2016 pdf
Cv 2016 pdf
 
Synthetic Identities and AML
Synthetic Identities and AMLSynthetic Identities and AML
Synthetic Identities and AML
 
Архитектура и интерфейсы Omega Production
Архитектура и интерфейсы Omega ProductionАрхитектура и интерфейсы Omega Production
Архитектура и интерфейсы Omega Production
 

Similar to MisuseCases

Solvay secure application layer v2015 seba
Solvay secure application layer v2015   sebaSolvay secure application layer v2015   seba
Solvay secure application layer v2015 sebaSebastien Deleersnyder
 
How to Destroy a Database
How to Destroy a DatabaseHow to Destroy a Database
How to Destroy a DatabaseJohn Ashmead
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top TenSecurity Innovation
 
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADFOWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADFBrian Huff
 
Crash Course In Brain Surgery
Crash Course In Brain SurgeryCrash Course In Brain Surgery
Crash Course In Brain Surgerymorisson
 
Zen and the art of Security Testing
Zen and the art of Security TestingZen and the art of Security Testing
Zen and the art of Security TestingTEST Huddle
 
App sec - code insecurity basics
App sec  - code insecurity basicsApp sec  - code insecurity basics
App sec - code insecurity basicsChristopher Hamm
 
Getting the most from Application Security in your SOC by Leigh Collett
Getting the most from Application Security in your SOC by Leigh CollettGetting the most from Application Security in your SOC by Leigh Collett
Getting the most from Application Security in your SOC by Leigh CollettJorge Carrillo, Ph.D
 
OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012ZIONSECURITY
 
Training Webinar: Cover your bases - a security webinar
Training Webinar: Cover your bases - a security webinarTraining Webinar: Cover your bases - a security webinar
Training Webinar: Cover your bases - a security webinarOutSystems
 
Secure software development presentation
Secure software development presentationSecure software development presentation
Secure software development presentationMahdi Dolati
 
Web Application Security Session for Web Developers
Web Application Security Session for Web DevelopersWeb Application Security Session for Web Developers
Web Application Security Session for Web DevelopersKrishna Srikanth Manda
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)Kishor Kumar
 
OWASP Top 10 - The Ten Most Critical Web Application Security Risks
OWASP Top 10 - The Ten Most Critical Web Application Security RisksOWASP Top 10 - The Ten Most Critical Web Application Security Risks
OWASP Top 10 - The Ten Most Critical Web Application Security RisksAll Things Open
 
Understanding and preventing sql injection attacks
Understanding and preventing sql injection attacksUnderstanding and preventing sql injection attacks
Understanding and preventing sql injection attacksKevin Kline
 
Owasp for dummies handouts
Owasp for dummies handoutsOwasp for dummies handouts
Owasp for dummies handoutsBCC
 
Oracle database threats - LAOUC Webinar
Oracle database threats - LAOUC WebinarOracle database threats - LAOUC Webinar
Oracle database threats - LAOUC WebinarOsama Mustafa
 
Understanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryUnderstanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryDaniel Miessler
 

Similar to MisuseCases (20)

Solvay secure application layer v2015 seba
Solvay secure application layer v2015   sebaSolvay secure application layer v2015   seba
Solvay secure application layer v2015 seba
 
How to Destroy a Database
How to Destroy a DatabaseHow to Destroy a Database
How to Destroy a Database
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top Ten
 
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADFOWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
OWASP Top 10 Security Vulnerabilities, and Securing them with Oracle ADF
 
Crash Course In Brain Surgery
Crash Course In Brain SurgeryCrash Course In Brain Surgery
Crash Course In Brain Surgery
 
Zen and the art of Security Testing
Zen and the art of Security TestingZen and the art of Security Testing
Zen and the art of Security Testing
 
App sec - code insecurity basics
App sec  - code insecurity basicsApp sec  - code insecurity basics
App sec - code insecurity basics
 
Getting the most from Application Security in your SOC by Leigh Collett
Getting the most from Application Security in your SOC by Leigh CollettGetting the most from Application Security in your SOC by Leigh Collett
Getting the most from Application Security in your SOC by Leigh Collett
 
OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012OWASP Top 10 vs Drupal - OWASP Benelux 2012
OWASP Top 10 vs Drupal - OWASP Benelux 2012
 
Training Webinar: Cover your bases - a security webinar
Training Webinar: Cover your bases - a security webinarTraining Webinar: Cover your bases - a security webinar
Training Webinar: Cover your bases - a security webinar
 
ASP.NET Web Security
ASP.NET Web SecurityASP.NET Web Security
ASP.NET Web Security
 
Secure software development presentation
Secure software development presentationSecure software development presentation
Secure software development presentation
 
Web Application Security Session for Web Developers
Web Application Security Session for Web DevelopersWeb Application Security Session for Web Developers
Web Application Security Session for Web Developers
 
Django (Web Applications that are Secure by Default)
Django �(Web Applications that are Secure by Default�)Django �(Web Applications that are Secure by Default�)
Django (Web Applications that are Secure by Default)
 
OWASP Top 10 - The Ten Most Critical Web Application Security Risks
OWASP Top 10 - The Ten Most Critical Web Application Security RisksOWASP Top 10 - The Ten Most Critical Web Application Security Risks
OWASP Top 10 - The Ten Most Critical Web Application Security Risks
 
Security in Node.JS and Express:
Security in Node.JS and Express:Security in Node.JS and Express:
Security in Node.JS and Express:
 
Understanding and preventing sql injection attacks
Understanding and preventing sql injection attacksUnderstanding and preventing sql injection attacks
Understanding and preventing sql injection attacks
 
Owasp for dummies handouts
Owasp for dummies handoutsOwasp for dummies handouts
Owasp for dummies handouts
 
Oracle database threats - LAOUC Webinar
Oracle database threats - LAOUC WebinarOracle database threats - LAOUC Webinar
Oracle database threats - LAOUC Webinar
 
Understanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryUnderstanding Cross-site Request Forgery
Understanding Cross-site Request Forgery
 

MisuseCases

  • 1.
  • 2. Misuse Cases – Security Requirements From a Different Viewpoint by Greg Sternberg, CISSP, MSc 2
  • 3. Bio » Worked with computers for decades a long time • Actually used punch cards a couple of times (and spilled once) » Done just about everything with them • Built them, programmed them, broke them, cursed them, … » Work at Sungard Availability Services as a Security Architect » Board member for ISSA, Denver, member of ISC(2), ISACA » Speaker (obviously), author » Certs: CISSP, CISM, TOGAF, MSc » Affiliate Faculty at Regis College 3
  • 4. Generic Requirements 4 » “Product ‘X’ must be secure and protect the customer’s data and the company’s IP.”
  • 5. Just Right (?) » “All data passing over the Internet or over insecure network links must be encrypted, either at the network layer (i.e. IPsec as used within VPNs), the transport layer (i.e. SSL), or the application layer (i.e. PGP mail). All network links that pass through non-company owned buildings must be treated as insecure. Only traffic contained within server rooms or other well-controlled locations may be excluded from the encryption requirement. FTP must be replaced with SSH, HTTP with HTTPS, etc... on all insecure links.” 5
  • 6. Negative Requirements » “Files containing the customer’s personal information shall not be sent via FTP.” • So email was used instead » “All passwords shall be >8 characters, have at least 1 numeric digit, have at least one upper case character and 1 special character.” • PASSWORD1! » “Unauthorized users shall not be allowed to log onto the system.” • So a shared account (admin / Company01) was used 6
  • 7. Misuse (What If?) Scenarios » Not a new concept • “Humans have analyzed negative scenarios ever since they first sat around Ice Age campfires debating the dangers of catching a woolly rhinoceros. ‘What if it turns and charges us before it falls into the pit?’” » We do it all the time: • Traffic • Events • Games • Insurance » Misuse vs. Abuse vs. Evil User Stories 7
  • 8. Where To Start? » Not a RIGHT way but plenty of right ways • User Story • Use case • UML diagram • Requirements » Not customer or user focused » Don’t need to think like a hacker » Won’t secure your system 8
  • 9. A Web Service » CRUD Order » Ship Order » Log in » Log out » CRUD User 9 General User Admin User Login Ship Order CRUD user CRUD Order Logout <<extend>>
  • 10. Web Service + Misuse » Unauthorized Address Change » Falsify Credentials » Intercept Communications » Prevent Legitimate Access 10 General User Admin User Login Ship Order CRUD user CRUD Order Logout Falisify Credentials Malicious User Intercept Communications Unauthorized Address Change Prevent Legitimate Access
  • 11. Web Service + Misuse + Remediation » 2-Factor Authentication » Lock Accounts » Validate Entries » Secure Transport » Throttling » Whitelisting 11 General User Admin User Login Ship Order CRUD user CRUD Order Logout Falisify Credentials Malicious User Lock Account Intercept Communications Unauthorized Address Change <<extend>> 2-Factor Authentication <<extend>> Secure Transport <<extend>> Validate Entries <<extend>> Prevent Legitimate Access Throttling Whitelisting <<extend>> <<extend>>
  • 12. Prevent Legitimate Access Name Prevent Legitimate Access Goal(s) Disrupt the system so it can no longer take legitimate login requests. Distract the administrators and security personal from the true goal of the hacker (i.e. system penetration) Actor(s) Hacker Assumption(s) None Precondition(s) There are externally facing access point(s) – i.e. URLs, APIs Event Flow 1. A fake or spoofed login request is generated 2. Many login requests are sent to the system using the external access point 3. The number of these login requests exceeds the capacity of the system to handle Alternate Flow(s) None Post Condition(s)  Legitimate users are unable to access the system  Applications (may) have abnormally stopped  Network response times are unacceptable  Application response times are unacceptable  Administrators and security are distracted and not monitoring the system closely
  • 13. Whitelisting » As this application is only useable by internal users, users who are connected to the corporate VPN or customers who have contracted to use it the firewall shall be configured to only allow the CIDR of X.X.X.X/20 or a customer provided CIDR.
  • 14. Another Approach » Attacker Scenario • Who – Hostile, accidental, threats, auditors • What – Assets, access, info • Means - Threats • Motive – Why do are they doing it? • Opportunity - Vulnerabilities 14
  • 15. When You Don’t Have A Single Software Process » Created a set of Agile OWASP Top 10 Misuse Stories • They have some place to start • They have a contact in security • There’s a consistency (in security at least) across projects • Focus more on elements that are unique to a project vs. the basics • Ties into ‘Software Security Assurance for the OWASP Top 10’ developer training » “Why you Shouldn’t Use the OWASP Top 10 as a List of Software Security Requirements.” 15
  • 16. A1 Injection » Injection flaws, such as SQL, OS, and LDAP injection occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing data without proper authorization. • As a [Specially Crafted Statement] I want to [take advantage of a lack of input validation] so that [I can retrieve information I'm not entitled to] • As a [Executable User Data] I want to [take advantage of a lack of data validation] so that [I can retrieve information I'm not entitled to] • As a [Editable Config File] I want to [take advantage of unvalidated configuration data] so that [I can have the program behave in a manner beneficial to me] 16
  • 17. As a [Specially Crafted Statement] I want to [take advantage of a lack of input validation] so that [I can retrieve information I'm not entitled to] » For example, if we use this Java: » user_name = request.getParameter (“UserName”); » query= “SELECT * FROM Users WHERE UserName=“ + user_name; » statement = connection.createStatement (query); » and the user types in 'Aeinstein' the SQL statement would look like: » SELECT * FROM Users WHERE UserName= 'Aeinstein'; » which would return just the record for 'Aeinstein'. However, if I were to type in something a bit different: » SELECT * FROM Users WHERE UserName='Aeinstein' or 1=1 » the database would end up translating the SQL statement to: » SELECT * FROM Users WHERE TRUE » Instead do the following: » PreparedStatement ps = connection prepareStatement (query); » ps.setString (1, username); » result = ps.executeQuery ();
  • 18. More Information » Alexander, I. (1999). Misuse Cases Help to Elicit Non-Functional Requirements. Retrieved from http://www.scenarioplus.org.uk/papers/misuse_cases/misuse_cases.htm » Alexander, I. Use/Misuse case analysis elicits non-functional requirements. Computing & Control Engineering Journal, Vol 14, 1, pp 40-45, February 2003. Retrieved from http://www.scenarioplus.org.uk/papers/misuse_cases_hostile_intent/misuse_case s_hostile_intent.htm » Allenby, K. & Kelly, T. Deriving Safety Requirements Using Scenarios. Proc. 5th International Symposium on Requirements Engineering RE'01, pp 228-235, 2001. » Cockburn, A. (2001). Writing effective use cases. Addison-Wesley. » Bird, Jim, Adding Appsec to Agile: Security Stories, Evil User Stories and Abuse(r) Stories, https://dzone.com/articles/adding-appsec-agile-security 18
  • 19. More Information » McGraw, G. (Ed.). (2004). Misuse and Abuse Cases: Getting Past the Positive. IEEE Security & Privacy 2004. Retrieved from http://www.cigital.com/papers/download/bsi2-misuse.pdf » OWASP, Agile Software Development: Don't Forget EVIL User Stories, https://www.owasp.org/index.php/Agile_Software_Development:_Don%27t_Forg et_EVIL_User_Stories » SAFECode – http://www.safecode.org/ » Sindre, G. & Opdahl, A. (2001). Templates for Misuse Case Description. Proc. 7th Intl Workshop on Requirements Engineering, Foundation for Software Quality (REFSQ'2001), Interlaken, Switzerland, 4-5 June 2001 » Srivatanakul, T., Clark, J., & Polack, F. (2004). Writing Effective Security Abuse Cases. University of York Technical Report YCS-2004-375 http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=976CD9803D704C0F2B 561C39C68519B1?doi=10.1.1.62.4125&rep=rep1&type=pdf 19
  • 20. Questions? 20 » If you liked the presentation: • gwstern@comcast.net • @gsternbe • https://www.linkedin.com/in/g regsternberg » Otherwise: • gwstern@spam.net • @_dev_null_
  • 22. Requirement vs. Use Case vs. User Story » Requirements • Nonfunctional – describe how the system works • Functional – describes what the system does • What the system is supposed to do at a level which can be tested and verified » Use Cases • A (usually) detailed description of a set of interactions between a system and one or more actors • About the behavior to meet the needs • Describe a complete interaction » User Stories/Scenarios • A short description of something the ‘customer’ wants to do focused on the result from doing that thing • About needs • Easy to read 22
  • 23. A2 – Broken Authentication and Session Management » Application functions related to authentication and session management are often not implemented correctly, allowing attackers to compromise passwords, keys, or session tokens, or to exploit other implementation flaws to assume other users’ identities. • As a [Forever User Session] I want to [be able to reuse session information] so that [I can reuse another user's session] • As a [Unencrypted A/A Token] I want to [log in as someone I'm not] so that [I can have unfettered access to the system] • As a [Simple Password] I want to [be easily broken] so that [I can pretend to be another user] • As a [Man In The Middle] I want to [pretend to be someone else] so that [I can trick the system (or user) into treating me as someone I’m not] • As a [Malicious User] I want to [find sessions that have not been closed] so that [I can pretend to be that user] 23
  • 24. A3 – Cross-Site Scripting / XSS » XSS flaws occur whenever an application takes untrusted data and sends it to a web browser without proper validation or escaping. XSS allows attackers to execute scripts in the victim’s browser which can hijack user sessions, deface web sites, or redirect the user to malicious sites • As a [Code In User Data] I want to [be executed] so that [I can have the program behave in an undesired manner] • As an [Malicious Client] I want to [send dangerous information to the server] so that [I can have the server behave how I want] • As an [Malicious Server] I want to [send dangerous information to the client] so that [I can have the client behave how I want] 24
  • 25. A4 – Insecure Direct Object References » A direct object reference occurs when a developer exposes a reference to an internal implementation object, such as a file, directory, or database key. Without an access control check or other protection, attackers can manipulate these references to access unauthorized data. • As a [Everyone Has Access To Everything] I want to [access information] so that [I can make copies of it for my personal use] • As an [Editor of URL Strings] I want to [try different URLs] so that [I can map out the directory hierarchy of the system] • As an [Editor of URL Strings] I want to [try different URL parameters] so that [I can alter the behavior of the system] • As a [Malicious Keyboard] I want to [change url] so that [I can get access to a different directory] 25
  • 26. A5 – Security Misconfiguration » Good security requires having a secure configuration defined and deployed for the application, frameworks, application server, web server, database server, and platform. Secure settings should be defined, implemented, and maintained, as defaults are often insecure. Additionally, software should be kept up to date. • As a [User of the Internet] I want to [find default information and try it] so that [I can gain access to systems] • As a [Lazy Malicious Person] I want to [try to access systems using existing backdoors] so that [I can steal data and control the system] • As a [Unsecured File] I want to [be modified] so that [a malicious attacker can change the system’s behavior] 26
  • 27. A6 – Sensitive Data Exposure » Many web applications do not properly protect sensitive data, such as credit cards, tax IDs, and authentication credentials. Attackers may steal or modify such weakly protected data to conduct credit card fraud, identity theft, or other crimes. Sensitive data deserves extra protection such as encryption at rest or in transit, as well as special precautions when exchanged with the browser. • As a [Reader of Caches] I want to [scan system and application caches] so that [I can glean sensitive data or passwords] • As a [Modifier of URLs] I want to [modify parameters] so that [I can have the system give me things for free] • As a [XML guru] I want to [modify XML parameters] so that [I can have the system behave in a fashion beneficial to me] 27
  • 28. A7 – Missing Function Level Access Control » Most web applications verify function level access rights before making that functionality visible in the UI. However, applications need to perform the same access control checks on the server when each function is accessed. If requests are not verified, attackers will be able to forge requests in order to access functionality without proper authorization. • As a [Malicious Program] I want to [try different parameters] so that [I can make the program behave in a fashion it is not supposed to] • As a [Malicious Client] I want to [bypass client controls] so that [I can affect the system] • As a [Creator of RESTful calls] I want to [pretend to be a legitimate invocation] so that [I can invoke methods I’m not otherwise allowed to invoke] 28
  • 29. A8 – Cross-Site Request Forgery / CSRF » A CSRF attack forces a logged-on victim’s browser to send a forged HTTP request, including the victim’s session cookie and any other automatically included authentication information, to a vulnerable web application. This allows the attacker to force the victim’s browser to generate requests the vulnerable application thinks are legitimate requests from the victim. • As a [Malicious User] I want to [find sessions that have not been closed] so that [I can pretend to be that user] • As an [Unvalidated Action] I want to [trick the browser to sending an HTTP request] so that [I can have it execute on behalf of the user, without their knowing] • As a [HTTP request With Side Effects] I want to [create a malicious side effect] so that [I can have the user execute it for me using their credentials] 29
  • 30. A9 – Using Known Vulnerable Components » Components, such as libraries, frameworks, and other software modules, almost always run with full privileges. If a vulnerable component is exploited, such an attack can facilitate serious data loss or server takeover. Applications using components with known vulnerabilities may undermine application defenses and enable a range of possible attacks and impacts. • As a [User of the Internet] I want to [try out known weaknesses] so that [I can discover an unpatched vulnerability] • As an [Unpatched System] I want to [present known weaknesses] so that [I can make it easy to be compromised] • As a [Third Party Library] I want to [run everything in the library with elevated privileges] so that [I can bypass security controls] 30
  • 31. A10 – Unvalidated Redirects and Forwards » Web applications frequently redirect and forward users to other pages and websites, and use untrusted data to determine the destination pages. Without proper validation, attackers can redirect victims to phishing or malware sites, or use forwards to access unauthorized pages. • As a [Malicious Keyboard] I want [modify the url] so that [cause a user to visit a place of my choosing, rather than theirs] 31
  • 32. 32

Editor's Notes

  1. Where to start…
  2. “All data” ? Why is it safe in the server rooms? What’s a “well-controlled location”? Secure communications but who handles the certs? What business requirement is this supporting? What risk(s) are being addressed and/or remediated?
  3. Yes, these are real examples Yes, these were the real solutions as well How do you prove a negative? Each of these requirements was technically met but I wouldn’t call the system secure What’s worse than no security? A false sense of security
  4. “” – Ian Alexander Is this guy going to cut me off? What if everyone falls asleep during my presentation? If White moves her King’s Bishop and threatens my King? / If White moves her queen and threatens my King’s Knight? / If White moves her pawn and captures my pawn? [What if] I die before I get old? (apologies to The Who) I call them “Misuse Cases” because I consider them to be more than just ‘hostile use cases’ Not used to generate negative requirements but to generate remediation use cases
  5. Needed, complete, clear, consistent, verifiable, traceable, feasible, design independent, atomic, correct Requirements Nonfunctional – describe how the system works Functional – describes what the system does What the system is supposed to do at a level which can be tested and verified Use Cases A (usually) detailed description of a set of interactions between a system and one or more actors About the behavior to meet the needs Describe a complete interaction User Stories/Scenarios A short description of something the ‘customer’ wants to do focused on the result from doing that thing About needs Easy to read Point of view of architects, developers, testers, and of course, security Not regulatory and compliance – that for ‘normal’ requirements Most people don’t come into work with the intention of writing insecure code Follow the data Who could see the data? Is that OK? What could go wrong Validate all parameters Good for identifying business logic vulnerabilities reviewing security features (authentication, access control, auditing, password management, licensing) improving error handling and basic validation, and keeping onside of privacy regulations.
  6. Misuse case threatens, use case mitigates By no means complete Follow the data
  7. Not complete
  8. Some of you might notice the similarity to U.S. criminal law where means, motive and opportunity is a common summation of the three aspects of a crime that must be established before guilt can be determined
  9. Infosec island – 21 Feb 2013 by Rohit Sethi Narrow project focus - Top 10 is all I need Top 10 is just that, the top 10 but there are a lot of other vulnerabilities (Mass Assignment vulnerability in Rails)
  10. "As a hacker, I can send bad data in URLs, so I can access data and functions for which I'm not authorized."
  11. User stories are about needs easy t read User cases are about the behavior to meet those needs describe a complete interaction