SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Input Validation
Eoin Keary
CTO BCC Risk Advisory
www.bccriskadvisory.com
www.edgescan.com
Where are we going?
Don’t ever trust user input
Where possible, use whitelist validation
Perform input validation at earliest possible stage
Layers of defense
Use in-built validator routines
Data Validation
Input that is not directly entered by the user is typically less prone to
validation
Attacks discussed in this section apply to external input from any client-side
source
Standard form input control
Read-only HTML form controls (drop down lists, radio buttons,
hidden fields, etc)
HTTP Cookie Values
HTTP Headers
Embedded URL parameters (e.g., in the GET request)
Data Validation
Known Bad
Known Good
Exact
Match
 Data Validation is
typically done using
one of three basic
approaches
 All input must be properly
validated on the server
(not the client) to ensure
that malicious data is not
accepted and processed
by the application
Data is validated against a list of explicit known values
Application footprint or “application attack surface” defined
Provides the strongest level of protection against malicious data
Often not feasible when a large number of possible good values are
expected
May require code modification any time input values are changed or
updated
Exact Match Validation
Example: Acceptable input is yes or no
if ($input eq“yes” or $input eq “no”)
Exact Match Validation Example
Validates the variable gender against 2 known values (.NET)
static bool validateGender(String gender)
{
if (gender.equals(“Female“))
return true;
else if (gender.equals(“Male“))
return true;
else
return false; //attack SOUND THE ALARM! BEEP BEEP!
}
Exact Match Validation Example
Validates the variable gender against 2 known values (Java)
static boolean validateGender (String
gender) {
if (gender.equals (“Female“))
return true;
else if (gender.equals (“Male“))
return true;
else
return false; //attack
}
Known Good Validation
Often called "white list" validation
Data is validated against a list of allowable characters and patterns
Typically implemented using regular expressions to match known good data patterns
Data type cast/convert functions can be used to verify data conforms to a certain
data type (i.e. Int32)
Expected input character values must be clearly defined for each input variable
Care must be taken if complex regular expressions are used
A common mistake is to forget to anchor the expression with ^ and $
Regular Expression Syntax
Symbol Match
^ Beginning of input string
$ End of input string
* Zero or more occurrences of previous character, short for {0,}
+ One or more occurrences of previous character, short for {1,}
? Zero or one occurrences of previous character, short for {0,1}
{n,m} At least n and at most m occurrences of previous character
. Any single character, except ‘n’
[xyz] A character set (i.e. any one of the enclosed characters)
[^xyz] A negative character set (i.e. any character except the enclosed)
[a-z] A range of characters
Regular Expression Syntax - shortcuts
Symbol Match
d Any digit, short for [0-9]
D A non-digit, short for [^0-9]
s A whitespace character, short for [ tnx0brf]
S A non-whitespace character, for short for [^s]
w A word character, short for [a-zA-Z_0-9]
W A non-word character [^w]
S+ Several non-whitespace characters
Example 1
Validating SSN entry
if ($input=~/^[0-9]{9}$/)
Example 2
Validating entry of a last name
if ($input=~/^[A-Za-z][-.'0-9A-Za-z]{1,256}$/)
Example 3
Validating SSN entry (Short cut)
if ($input=~/^d{9}$/)
Examples 123-56-3454
Regular Expressions - Templates
Field Expression Format Samples Description
Name ^[a-zA-Z-'s]{1,40}$ John Doe Validates a name. Allows up to 40 uppercase and lowercase characters and a few special
characters that are common to some names. You can modify this list.
Social Security
Number
^d{3}-d{2}-d{4}$ 111-11-1111 Validates the format, type, and length of the supplied input field. The input must consist of 3
numeric characters followed by a dash, then 2 numeric characters followed by a dash, and
then 4 numeric characters.
Phone Number ^[01]?[- .]?(([2-9]d{2})|[2-
9]d{2})[- .]?d{3}[- .]?d{4}$
(425) 555-0123 Validates a U.S. phone number. It must consist of 3 numeric characters, optionally enclosed in
parentheses, followed by a set of 3 numeric characters and then a set of 4 numeric
characters.
E-mail ^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-
]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-
]+)*$
someone@exampl
e.com
Validates an e-mail address. (per the HTML5 specification
http://www.w3.org/TR/html5/forms.html#valid-e-mail-address).
URL ^(ht|f)tp(s?)://[0-9a-zA-Z]([-
.w]*[0-9a-zA-Z])*(:(0-
9)*)*(/?)([a-zA-Z0-9-
.?,'/+&%$#_]*)?$
http://www.micros
oft.com
Validates a URL
ZIP Code ^(d{5}-d{4}|d{5}|d{9})$|^([a-
zA-Z]d[a-zA-Z] d[a-zA-Z]d)$
12345 Validates a U.S. ZIP Code. The code must consist of 5 or 9 numeric characters.
Password (?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-
zA-Z0-9]{8,10})$
Validates a strong password. It must be between 8 and 10 characters, contain at least one
digit and one alphabetic character, and must not contain special characters.
Non- negative
integer
^d+$ 0 Validates that the field contains an integer greater than zero.
Currency (non-
negative)
^d+(.dd)?$ 1 Validates a positive currency amount. If there is a decimal point, it requires 2 numeric
characters after the decimal point. For example, 3.00 is valid but 3.1 is not.
Currency
(positive or
negative)
^(-)?d+(.dd)?$ 1.2 Validates for a positive or negative currency amount. If there is a decimal point, it requires 2
numeric characters after the decimal point.
Regular Expressions
Regular Expressions is a term used to refer to a pattern-matching technology
for processing text
Although there is no standards body governing the regular expression
language, Perl 5, by virtue of its popularity, has set the standard for regular
expression syntax
A Regular Expression itself is a string that represents a pattern, encoded
using the regular expression language and syntax
Regular Expression - Zend
$validator = new Zend_Validate_Regex(array('pattern' => '/^Test/');
$validator->isValid("Test"); // returns true
$validator->isValid("Testing"); // returns true
$validator->isValid("Pest"); // returns false
Data Validation Techniques
Validates against a regular expression representing the proper expected data format
(10 alphanumeric characters) (.NET)
using System.Text.RegularExpressions;
static bool validateUserFormat(String userName) {
bool isValid = false; //Fail by default
// Verify that the UserName is 1-10 character alphanumeric
isValid = Regex.IsMatch(userName, @"^[A-Za-z0-9]{10}$");
return isValid;
}
Regular Expressions - assertions
Assert a string is 8 or more characters:
(?=.{8,})
Assert a string contains at least 1 lowercase letter (zero or more characters followed by
a lowercase character):
(?=.*[a-z])
Assert a string contains at least 1 uppercase letter (zero or more characters followed by
an uppercase character):
(?=.*[A-Z])
Assert a string contains at least 1 digit:
(?=.*[d])
So if you want to match a string at least 6 characters long, with at least one lower case
and at least one uppercase letter you could use something like:
^.*(?=.{6,})(?=.*[a-z])(?=.*[A-Z]).*$
Known Good Validation Example
Validates against a regular expression representing the proper expected data
format (10 alphanumeric characters) (Java)
import java.util.regex.*;
static boolean validateUserFormat(String userName){
boolean isValid = false; //Fail by default
try{
// Verify that the UserName is 10 character alphanumeric
if (Pattern.matches(“^[A-Za-z0-9]{10}$”, userName))
isValid=true;
} catch(PatternSyntaxException e) {
System.out.println(e.getDescription());
}
return isValid;
}
Known Good Example
$validator = new Zend_Validate_Alnum();
if ($validator->isValid('Abcd12')) {
// value contains only allowed chars
} else {
// false
}
Known Good Example - Chains
// Create a validator chain and add validators to it
$validatorChain = new Zend_Validate();
$validatorChain->addValidator(
new Zend_Validate_StringLength(array('min' => 6, 'max' => 12)))
->addValidator(new Zend_Validate_Alnum());
// Validate the username
if ($validatorChain->isValid($username)) {
// username passed validation
} else {
// username failed validation; print reasons or whatever…..
foreach ($validatorChain->getMessages() as $message) {
echo "$messagen";
}
Often called "BlackList" validation
Data is validated against a list of characters that are deemed to be dangerous
or unacceptable
Useful for preventing specific characters from being accepted by the
application
Provides the weakest method of validation against malicious data
Susceptible to bypass using various forms of character encoding
Known Bad Validation
Example: Validating entry into generic text field
if ($input !~/[rtn><();+&%’”*|]/)
Known Bad Validation Example
Validates against a regular expression of known bad input strings (.Net)
using System.Text.RegularExpressions;
static boolean checkMessage(string messageText){
bool isValid = false; //Fail by default
// Verify input doesn’t contain any < , >
isValid = !Regex.IsMatch(messageText, @"[><]");
return isValid;
}
Known Bad Validation Example
Validates against a regular expression of known bad input strings (Java)
import java.util.regex.*;
static boolean checkMessage (string messageText) {
boolean isValid = false; //Fail by default
try {
Pattern P = Pattern.compile (“<|>”,
Pattern.CASE_INSENSITIVE | Pattern.MULTILINE);
Matcher M = p.matcher(messageText);
if (!M.find())
isValid = true;
} catch(Exception e) {
System.out.println(e.toString());
}
return isValid;
}
Bounds Checking
All external input must
also be properly validated
to ensure that excessively
large input is rejected
Length checking: A maximum length check should be
performed on all incoming application data.
Careful about name length! Lokelani
Keihanaikukauakahihuliheekahaunaele is a real
person!
Input that exceeds the
appropriate length or size
limits must be rejected
and not processed by the
application
Size checking: A maximum size check should be
performed on all incoming data files
The following code reads a String from a file.
Because it uses the readLine() method, it will read an unbounded amount of input until
a <newline> (n) charter is read.
InputStream Input = inputfileFile.getInputStream(Entry);
Reader inpReader = new InputStreamReader(Input);
BufferedReader br = new BufferedReader(inpReader);
String line = br.readLine();
This could be taken advantage of and cause an OutOfMemoryException or to consume a
large amount of memory which shall affect performance and initiate costly garbage
collection routines.
Bounds Checking – Example
Unbounded Reading of a file
Bounds checking
$validator = new Zend_Validate_StringLength(array('max' => 6));
$validator->isValid("Test"); // returns true
$validator->isValid("Testing"); // returns false
Bounds checking – File size
$upload = new Zend_File_Transfer();
// Limit the size of all files to be uploaded to 40000 bytes
$upload->addValidator('FilesSize', false, 40000);
// Limit the size of all files to be uploaded to maximum 4MB and mimimum 10kB
$upload->addValidator('FilesSize', false, array('min' => '10kB', 'max' => '4MB'));
.NET Validator Controls:
RequiredFieldValidator, CompareValidator, RangeValidator,
RegularExpressionValidator, CustomValidator, ValidateRequest
Jakarta Commons Validator:
required, mask, range, maxLength, minLength, datatype, date,
creditCard, email, regularExpression
Native Validation Controls
Many development platforms have native validator controls, such as Jakarta and .NET
Escaping vs. Rejecting
When validating data, one can either reject data failing to meet validation
requirements or attempt to “clean” or escape dangerous characters
Failed validation attempts should always reject the data to minimise the risk
that sanitisation routines will be ineffective or can be bypassed
Error messages displayed when rejecting data should specify the proper
format for the user to enter appropriate data
Error messages should not redisplay the input the user has entered
The Problem with Escaping
--- Snip ---
page_template = request.queryString("page")
replace(page_template , "/", "")
replace(page_template, "..", "")
getFile(page_template)
--- End Snip ---
http://www.example.com/content/default.jsp?page=info.htm
 Page_template = info.htm <- First Pass
 Page_template = info.htm <- Second Pass
http://www.example.com/content/default.jsp?page=../web.xml
 Page_template = .. web.xml <- First Pass
 Page_template = web.xml <- Second Pass
http://www.example.com/content/default.jsp?page=....//web.xml
 Page_template = ....web.xml <- First Pass
 Page_template = ..web.xml <- Second Pass
Input Based Attacks
Malicious user input can be used to launch a variety of attacks against an application. These
attacks include, but are not limited to:
Parameter
Manipulation
 Cookie poisoning
 Hidden field manipulation
Content
injection
 SQL
 HTTP Response Splitting
 Operating system calls
 Command insertion
 XPath
Cross site
scripting
 …
Buffer
overflows
 Format string attacks
Parameter Manipulation
Applications typically pass parameters that determine what the user can do
or see
Unauthorised access to application data can be obtained by manipulating
parameter values, if record-level authorisation checks are not performed
within the application code
Many applications tend to pass sensitive parameters back and forth rather
than using server session variables to store the information
Very common to see this in
HTTP cookies
“hidden” HTML form fields
Parameter Manipulation
Database record index numbers are often passed as page parameters to
view a specific record
If there is a relatively small range of possible index values, sequential
parameter values can by cycled to view other records
Even-non sequential indexing can be attacked within a small range of
potential values
Manipulating parameter values can be trivial when other obvious valid
Values exist:
Username=joe (change to username=mary)
Privilege=user (change to privilege=admin)
Price=100.00 (change to price=1.00)
Testing for Parameter Manipulation
Identify areas in the application where records appear to be displayed based
on input parameters
Attempt to access records using other known valid parameter values
For parameter values that seem to fall within a variable range, cycle through
the range to search for other valid records
Identify all data being passed in hidden fields. Attempt to determine:
What the data is being used for
Whether use of a hidden field seems appropriate
Defenses Against Parameter
Manipulation
Data that should not be altered should never be passed to the client
Always perform validation on the server
Use the most restrictive input validation method possible
Use Exact Match Validation to verify that parameters values are
appropriate for the specific transaction or user’s permission level
In situations where a query or hash table lookup is required, Known Good
Validation should be used to validate the parameter before performing
the lookup
Retrieve the information from the client once, validate it and keep it on the
server associated with that user’s session
Summary
Don’t ever trust user input
Where possible, use whitelist validation
Perform input validation at earliest possible stage
Layers of defense
Use in-built validator routines

Weitere ähnliche Inhalte

Was ist angesagt?

OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesSoftware Guru
 
Security Code Review 101
Security Code Review 101Security Code Review 101
Security Code Review 101Paul Ionescu
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIRasan Samarasinghe
 
Security Vulnerabilities
Security VulnerabilitiesSecurity Vulnerabilities
Security VulnerabilitiesMarius Vorster
 
Sql injection in cybersecurity
Sql injection in cybersecuritySql injection in cybersecurity
Sql injection in cybersecuritySanad Bhowmik
 
Sql injections - with example
Sql injections - with exampleSql injections - with example
Sql injections - with examplePrateek Chauhan
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application SecurityAbdul Wahid
 
Web App Security Presentation by Ryan Holland - 05-31-2017
Web App Security Presentation by Ryan Holland - 05-31-2017Web App Security Presentation by Ryan Holland - 05-31-2017
Web App Security Presentation by Ryan Holland - 05-31-2017TriNimbus
 
Secure Coding 101 - OWASP University of Ottawa Workshop
Secure Coding 101 - OWASP University of Ottawa WorkshopSecure Coding 101 - OWASP University of Ottawa Workshop
Secure Coding 101 - OWASP University of Ottawa WorkshopPaul Ionescu
 
Ch 3: Web Application Technologies
Ch 3: Web Application TechnologiesCh 3: Web Application Technologies
Ch 3: Web Application TechnologiesSam Bowne
 
Sql injection
Sql injectionSql injection
Sql injectionZidh
 
Application Security
Application SecurityApplication Security
Application Securityflorinc
 
Secure Coding - Web Application Security Vulnerabilities and Best Practices
Secure Coding - Web Application Security Vulnerabilities and Best PracticesSecure Coding - Web Application Security Vulnerabilities and Best Practices
Secure Coding - Web Application Security Vulnerabilities and Best PracticesWebsecurify
 

Was ist angesagt? (20)

SSRF exploit the trust relationship
SSRF exploit the trust relationshipSSRF exploit the trust relationship
SSRF exploit the trust relationship
 
Pentesting ReST API
Pentesting ReST APIPentesting ReST API
Pentesting ReST API
 
OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application Vulnerabilities
 
Security Code Review 101
Security Code Review 101Security Code Review 101
Security Code Review 101
 
Bug bounty
Bug bountyBug bounty
Bug bounty
 
Xss attack
Xss attackXss attack
Xss attack
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST API
 
Security Vulnerabilities
Security VulnerabilitiesSecurity Vulnerabilities
Security Vulnerabilities
 
Sql injection in cybersecurity
Sql injection in cybersecuritySql injection in cybersecurity
Sql injection in cybersecurity
 
Web Application Security 101
Web Application Security 101Web Application Security 101
Web Application Security 101
 
Sql injections - with example
Sql injections - with exampleSql injections - with example
Sql injections - with example
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
Web App Security Presentation by Ryan Holland - 05-31-2017
Web App Security Presentation by Ryan Holland - 05-31-2017Web App Security Presentation by Ryan Holland - 05-31-2017
Web App Security Presentation by Ryan Holland - 05-31-2017
 
Secure Coding 101 - OWASP University of Ottawa Workshop
Secure Coding 101 - OWASP University of Ottawa WorkshopSecure Coding 101 - OWASP University of Ottawa Workshop
Secure Coding 101 - OWASP University of Ottawa Workshop
 
Ch 3: Web Application Technologies
Ch 3: Web Application TechnologiesCh 3: Web Application Technologies
Ch 3: Web Application Technologies
 
Sql injection
Sql injectionSql injection
Sql injection
 
Application Security
Application SecurityApplication Security
Application Security
 
Secure Coding - Web Application Security Vulnerabilities and Best Practices
Secure Coding - Web Application Security Vulnerabilities and Best PracticesSecure Coding - Web Application Security Vulnerabilities and Best Practices
Secure Coding - Web Application Security Vulnerabilities and Best Practices
 
Sql injection
Sql injectionSql injection
Sql injection
 

Andere mochten auch

Web forms and server side scripting
Web forms and server side scriptingWeb forms and server side scripting
Web forms and server side scriptingsawsan slii
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScriptRavi Bhadauria
 
1 - Designing A Site
1 - Designing A Site1 - Designing A Site
1 - Designing A SiteGraeme Smith
 
Flex security
Flex securityFlex security
Flex securitychengalva
 
Javascript validation assignment
Javascript validation assignmentJavascript validation assignment
Javascript validation assignmentH K
 
Business Interfaces using Virtual Objects, Visual-Force Forms and JavaScript
Business Interfaces using Virtual Objects, Visual-Force Forms and JavaScriptBusiness Interfaces using Virtual Objects, Visual-Force Forms and JavaScript
Business Interfaces using Virtual Objects, Visual-Force Forms and JavaScriptSalesforce Developers
 
HTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input ValidationHTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input ValidationTodd Anglin
 
Authentication Protocols
Authentication ProtocolsAuthentication Protocols
Authentication ProtocolsTrinity Dwarka
 
Validation rule, validation text and input masks
Validation rule, validation text and input masksValidation rule, validation text and input masks
Validation rule, validation text and input masksfizahPhd
 
HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIsRemy Sharp
 
8 Authentication Security Protocols
8 Authentication Security Protocols8 Authentication Security Protocols
8 Authentication Security Protocolsguestfbf635
 
Slideshare.Com Powerpoint
Slideshare.Com PowerpointSlideshare.Com Powerpoint
Slideshare.Com Powerpointguested929b
 
TEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkTEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkVolker Hirsch
 

Andere mochten auch (20)

Form Validation
Form ValidationForm Validation
Form Validation
 
Web forms and server side scripting
Web forms and server side scriptingWeb forms and server side scripting
Web forms and server side scripting
 
Form Validation in JavaScript
Form Validation in JavaScriptForm Validation in JavaScript
Form Validation in JavaScript
 
1 - Designing A Site
1 - Designing A Site1 - Designing A Site
1 - Designing A Site
 
Flex security
Flex securityFlex security
Flex security
 
Javascript validation assignment
Javascript validation assignmentJavascript validation assignment
Javascript validation assignment
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Business Interfaces using Virtual Objects, Visual-Force Forms and JavaScript
Business Interfaces using Virtual Objects, Visual-Force Forms and JavaScriptBusiness Interfaces using Virtual Objects, Visual-Force Forms and JavaScript
Business Interfaces using Virtual Objects, Visual-Force Forms and JavaScript
 
HTML5
HTML5HTML5
HTML5
 
HTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input ValidationHTML5 Mullet: Forms & Input Validation
HTML5 Mullet: Forms & Input Validation
 
Authentication Protocols
Authentication ProtocolsAuthentication Protocols
Authentication Protocols
 
Javascript validating form
Javascript validating formJavascript validating form
Javascript validating form
 
Validation rule, validation text and input masks
Validation rule, validation text and input masksValidation rule, validation text and input masks
Validation rule, validation text and input masks
 
Ch3 server controls
Ch3 server controlsCh3 server controls
Ch3 server controls
 
HTML5 JavaScript APIs
HTML5 JavaScript APIsHTML5 JavaScript APIs
HTML5 JavaScript APIs
 
8 Authentication Security Protocols
8 Authentication Security Protocols8 Authentication Security Protocols
8 Authentication Security Protocols
 
Java script ppt
Java script pptJava script ppt
Java script ppt
 
Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices
 
Slideshare.Com Powerpoint
Slideshare.Com PowerpointSlideshare.Com Powerpoint
Slideshare.Com Powerpoint
 
TEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkTEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of Work
 

Ähnlich wie 02. input validation module v5

Secure Dot Net Programming
Secure Dot Net ProgrammingSecure Dot Net Programming
Secure Dot Net ProgrammingAdam Getchell
 
PHP Built-in String Validation Functions
PHP Built-in String Validation FunctionsPHP Built-in String Validation Functions
PHP Built-in String Validation FunctionsAung Khant
 
Php Security By Mugdha And Anish
Php Security By Mugdha And AnishPhp Security By Mugdha And Anish
Php Security By Mugdha And AnishOSSCube
 
TestFest - Respect\Validation 1.0
TestFest - Respect\Validation 1.0TestFest - Respect\Validation 1.0
TestFest - Respect\Validation 1.0Henrique Moody
 
Form validation server side
Form validation server side Form validation server side
Form validation server side Mudasir Syed
 
Leveraging Scala Macros for Better Validation
Leveraging Scala Macros for Better ValidationLeveraging Scala Macros for Better Validation
Leveraging Scala Macros for Better ValidationTomer Gabel
 
Validation and input formatting
Validation and input formattingValidation and input formatting
Validation and input formattingNeha Kaurav
 
Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01google
 
Computational Problem Solving 004 (1).pptx (1).pdf
Computational Problem Solving 004 (1).pptx (1).pdfComputational Problem Solving 004 (1).pptx (1).pdf
Computational Problem Solving 004 (1).pptx (1).pdfSadhikaPolamarasetti1
 
QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...
QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...
QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...GeeksLab Odessa
 
Php Security3895
Php Security3895Php Security3895
Php Security3895Aung Khant
 
API first with Swagger and Scala by Slava Schmidt
API first with Swagger and Scala by  Slava SchmidtAPI first with Swagger and Scala by  Slava Schmidt
API first with Swagger and Scala by Slava SchmidtJavaDayUA
 

Ähnlich wie 02. input validation module v5 (20)

Secure Dot Net Programming
Secure Dot Net ProgrammingSecure Dot Net Programming
Secure Dot Net Programming
 
PHP Built-in String Validation Functions
PHP Built-in String Validation FunctionsPHP Built-in String Validation Functions
PHP Built-in String Validation Functions
 
Php Security By Mugdha And Anish
Php Security By Mugdha And AnishPhp Security By Mugdha And Anish
Php Security By Mugdha And Anish
 
vb.net.pdf
vb.net.pdfvb.net.pdf
vb.net.pdf
 
Lecture7 pattern
Lecture7 patternLecture7 pattern
Lecture7 pattern
 
TestFest - Respect\Validation 1.0
TestFest - Respect\Validation 1.0TestFest - Respect\Validation 1.0
TestFest - Respect\Validation 1.0
 
Form validation server side
Form validation server side Form validation server side
Form validation server side
 
Unit testing zend framework apps
Unit testing zend framework appsUnit testing zend framework apps
Unit testing zend framework apps
 
Leveraging Scala Macros for Better Validation
Leveraging Scala Macros for Better ValidationLeveraging Scala Macros for Better Validation
Leveraging Scala Macros for Better Validation
 
Validation and input formatting
Validation and input formattingValidation and input formatting
Validation and input formatting
 
Drupal7 dbtng
Drupal7  dbtngDrupal7  dbtng
Drupal7 dbtng
 
Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01Linq 090701233237 Phpapp01
Linq 090701233237 Phpapp01
 
Computational Problem Solving 004 (1).pptx (1).pdf
Computational Problem Solving 004 (1).pptx (1).pdfComputational Problem Solving 004 (1).pptx (1).pdf
Computational Problem Solving 004 (1).pptx (1).pdf
 
QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...
QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...
QA Lab: тестирование ПО. Станислав Шмидт: "Self-testing REST APIs with API Fi...
 
Email Validation
Email ValidationEmail Validation
Email Validation
 
Php Security3895
Php Security3895Php Security3895
Php Security3895
 
API first with Swagger and Scala by Slava Schmidt
API first with Swagger and Scala by  Slava SchmidtAPI first with Swagger and Scala by  Slava Schmidt
API first with Swagger and Scala by Slava Schmidt
 
Php & my sql
Php & my sqlPhp & my sql
Php & my sql
 
Defending against Injections
Defending against InjectionsDefending against Injections
Defending against Injections
 
Forms
FormsForms
Forms
 

Mehr von Eoin Keary

IISF-March2023.pptx
IISF-March2023.pptxIISF-March2023.pptx
IISF-March2023.pptxEoin Keary
 
Validation of vulnerabilities.pdf
Validation of vulnerabilities.pdfValidation of vulnerabilities.pdf
Validation of vulnerabilities.pdfEoin Keary
 
Does a Hybrid model for vulnerability Management Make Sense.pdf
Does a Hybrid model for vulnerability Management Make Sense.pdfDoes a Hybrid model for vulnerability Management Make Sense.pdf
Does a Hybrid model for vulnerability Management Make Sense.pdfEoin Keary
 
Edgescan 2022 Vulnerability Statistics Report
Edgescan 2022 Vulnerability Statistics ReportEdgescan 2022 Vulnerability Statistics Report
Edgescan 2022 Vulnerability Statistics ReportEoin Keary
 
Edgescan 2021 Vulnerability Stats Report
Edgescan 2021 Vulnerability Stats ReportEdgescan 2021 Vulnerability Stats Report
Edgescan 2021 Vulnerability Stats ReportEoin Keary
 
One login enemy at the gates
One login enemy at the gatesOne login enemy at the gates
One login enemy at the gatesEoin Keary
 
Edgescan vulnerability stats report 2020
Edgescan vulnerability stats report 2020Edgescan vulnerability stats report 2020
Edgescan vulnerability stats report 2020Eoin Keary
 
edgescan vulnerability stats report (2018)
 edgescan vulnerability stats report (2018)  edgescan vulnerability stats report (2018)
edgescan vulnerability stats report (2018) Eoin Keary
 
edgescan vulnerability stats report (2019)
edgescan vulnerability stats report (2019) edgescan vulnerability stats report (2019)
edgescan vulnerability stats report (2019) Eoin Keary
 
Full stack vulnerability management at scale
Full stack vulnerability management at scaleFull stack vulnerability management at scale
Full stack vulnerability management at scaleEoin Keary
 
Vulnerability Intelligence - Standing Still in a world full of change
Vulnerability Intelligence - Standing Still in a world full of changeVulnerability Intelligence - Standing Still in a world full of change
Vulnerability Intelligence - Standing Still in a world full of changeEoin Keary
 
Edgescan vulnerability stats report 2019 - h-isac-2-2-2019
Edgescan   vulnerability stats report 2019 - h-isac-2-2-2019Edgescan   vulnerability stats report 2019 - h-isac-2-2-2019
Edgescan vulnerability stats report 2019 - h-isac-2-2-2019Eoin Keary
 
Hide and seek - Attack Surface Management and continuous assessment.
Hide and seek - Attack Surface Management and continuous assessment.Hide and seek - Attack Surface Management and continuous assessment.
Hide and seek - Attack Surface Management and continuous assessment.Eoin Keary
 
Online Gaming Cyber security and Threat Model
Online Gaming Cyber security and Threat ModelOnline Gaming Cyber security and Threat Model
Online Gaming Cyber security and Threat ModelEoin Keary
 
Keeping the wolf from 1000 doors.
Keeping the wolf from 1000 doors.Keeping the wolf from 1000 doors.
Keeping the wolf from 1000 doors.Eoin Keary
 
Security by the numbers
Security by the numbersSecurity by the numbers
Security by the numbersEoin Keary
 
Web security – everything we know is wrong cloud version
Web security – everything we know is wrong   cloud versionWeb security – everything we know is wrong   cloud version
Web security – everything we know is wrong cloud versionEoin Keary
 
Cybersecurity by the numbers
Cybersecurity by the numbersCybersecurity by the numbers
Cybersecurity by the numbersEoin Keary
 
Ebu class edgescan-2017
Ebu class edgescan-2017Ebu class edgescan-2017
Ebu class edgescan-2017Eoin Keary
 
Vulnerability management and threat detection by the numbers
Vulnerability management and threat detection by the numbersVulnerability management and threat detection by the numbers
Vulnerability management and threat detection by the numbersEoin Keary
 

Mehr von Eoin Keary (20)

IISF-March2023.pptx
IISF-March2023.pptxIISF-March2023.pptx
IISF-March2023.pptx
 
Validation of vulnerabilities.pdf
Validation of vulnerabilities.pdfValidation of vulnerabilities.pdf
Validation of vulnerabilities.pdf
 
Does a Hybrid model for vulnerability Management Make Sense.pdf
Does a Hybrid model for vulnerability Management Make Sense.pdfDoes a Hybrid model for vulnerability Management Make Sense.pdf
Does a Hybrid model for vulnerability Management Make Sense.pdf
 
Edgescan 2022 Vulnerability Statistics Report
Edgescan 2022 Vulnerability Statistics ReportEdgescan 2022 Vulnerability Statistics Report
Edgescan 2022 Vulnerability Statistics Report
 
Edgescan 2021 Vulnerability Stats Report
Edgescan 2021 Vulnerability Stats ReportEdgescan 2021 Vulnerability Stats Report
Edgescan 2021 Vulnerability Stats Report
 
One login enemy at the gates
One login enemy at the gatesOne login enemy at the gates
One login enemy at the gates
 
Edgescan vulnerability stats report 2020
Edgescan vulnerability stats report 2020Edgescan vulnerability stats report 2020
Edgescan vulnerability stats report 2020
 
edgescan vulnerability stats report (2018)
 edgescan vulnerability stats report (2018)  edgescan vulnerability stats report (2018)
edgescan vulnerability stats report (2018)
 
edgescan vulnerability stats report (2019)
edgescan vulnerability stats report (2019) edgescan vulnerability stats report (2019)
edgescan vulnerability stats report (2019)
 
Full stack vulnerability management at scale
Full stack vulnerability management at scaleFull stack vulnerability management at scale
Full stack vulnerability management at scale
 
Vulnerability Intelligence - Standing Still in a world full of change
Vulnerability Intelligence - Standing Still in a world full of changeVulnerability Intelligence - Standing Still in a world full of change
Vulnerability Intelligence - Standing Still in a world full of change
 
Edgescan vulnerability stats report 2019 - h-isac-2-2-2019
Edgescan   vulnerability stats report 2019 - h-isac-2-2-2019Edgescan   vulnerability stats report 2019 - h-isac-2-2-2019
Edgescan vulnerability stats report 2019 - h-isac-2-2-2019
 
Hide and seek - Attack Surface Management and continuous assessment.
Hide and seek - Attack Surface Management and continuous assessment.Hide and seek - Attack Surface Management and continuous assessment.
Hide and seek - Attack Surface Management and continuous assessment.
 
Online Gaming Cyber security and Threat Model
Online Gaming Cyber security and Threat ModelOnline Gaming Cyber security and Threat Model
Online Gaming Cyber security and Threat Model
 
Keeping the wolf from 1000 doors.
Keeping the wolf from 1000 doors.Keeping the wolf from 1000 doors.
Keeping the wolf from 1000 doors.
 
Security by the numbers
Security by the numbersSecurity by the numbers
Security by the numbers
 
Web security – everything we know is wrong cloud version
Web security – everything we know is wrong   cloud versionWeb security – everything we know is wrong   cloud version
Web security – everything we know is wrong cloud version
 
Cybersecurity by the numbers
Cybersecurity by the numbersCybersecurity by the numbers
Cybersecurity by the numbers
 
Ebu class edgescan-2017
Ebu class edgescan-2017Ebu class edgescan-2017
Ebu class edgescan-2017
 
Vulnerability management and threat detection by the numbers
Vulnerability management and threat detection by the numbersVulnerability management and threat detection by the numbers
Vulnerability management and threat detection by the numbers
 

Kürzlich hochgeladen

Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.soniya singh
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceDelhi Call girls
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...SUHANI PANDEY
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...roncy bisnoi
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls DubaiEscorts Call Girls
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...SUHANI PANDEY
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...SUHANI PANDEY
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 

Kürzlich hochgeladen (20)

valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 

02. input validation module v5

  • 1. Input Validation Eoin Keary CTO BCC Risk Advisory www.bccriskadvisory.com www.edgescan.com
  • 2. Where are we going? Don’t ever trust user input Where possible, use whitelist validation Perform input validation at earliest possible stage Layers of defense Use in-built validator routines
  • 3. Data Validation Input that is not directly entered by the user is typically less prone to validation Attacks discussed in this section apply to external input from any client-side source Standard form input control Read-only HTML form controls (drop down lists, radio buttons, hidden fields, etc) HTTP Cookie Values HTTP Headers Embedded URL parameters (e.g., in the GET request)
  • 4. Data Validation Known Bad Known Good Exact Match  Data Validation is typically done using one of three basic approaches  All input must be properly validated on the server (not the client) to ensure that malicious data is not accepted and processed by the application
  • 5. Data is validated against a list of explicit known values Application footprint or “application attack surface” defined Provides the strongest level of protection against malicious data Often not feasible when a large number of possible good values are expected May require code modification any time input values are changed or updated Exact Match Validation Example: Acceptable input is yes or no if ($input eq“yes” or $input eq “no”)
  • 6. Exact Match Validation Example Validates the variable gender against 2 known values (.NET) static bool validateGender(String gender) { if (gender.equals(“Female“)) return true; else if (gender.equals(“Male“)) return true; else return false; //attack SOUND THE ALARM! BEEP BEEP! }
  • 7. Exact Match Validation Example Validates the variable gender against 2 known values (Java) static boolean validateGender (String gender) { if (gender.equals (“Female“)) return true; else if (gender.equals (“Male“)) return true; else return false; //attack }
  • 8. Known Good Validation Often called "white list" validation Data is validated against a list of allowable characters and patterns Typically implemented using regular expressions to match known good data patterns Data type cast/convert functions can be used to verify data conforms to a certain data type (i.e. Int32) Expected input character values must be clearly defined for each input variable Care must be taken if complex regular expressions are used A common mistake is to forget to anchor the expression with ^ and $
  • 9. Regular Expression Syntax Symbol Match ^ Beginning of input string $ End of input string * Zero or more occurrences of previous character, short for {0,} + One or more occurrences of previous character, short for {1,} ? Zero or one occurrences of previous character, short for {0,1} {n,m} At least n and at most m occurrences of previous character . Any single character, except ‘n’ [xyz] A character set (i.e. any one of the enclosed characters) [^xyz] A negative character set (i.e. any character except the enclosed) [a-z] A range of characters
  • 10. Regular Expression Syntax - shortcuts Symbol Match d Any digit, short for [0-9] D A non-digit, short for [^0-9] s A whitespace character, short for [ tnx0brf] S A non-whitespace character, for short for [^s] w A word character, short for [a-zA-Z_0-9] W A non-word character [^w] S+ Several non-whitespace characters
  • 11. Example 1 Validating SSN entry if ($input=~/^[0-9]{9}$/) Example 2 Validating entry of a last name if ($input=~/^[A-Za-z][-.'0-9A-Za-z]{1,256}$/) Example 3 Validating SSN entry (Short cut) if ($input=~/^d{9}$/) Examples 123-56-3454
  • 12. Regular Expressions - Templates Field Expression Format Samples Description Name ^[a-zA-Z-'s]{1,40}$ John Doe Validates a name. Allows up to 40 uppercase and lowercase characters and a few special characters that are common to some names. You can modify this list. Social Security Number ^d{3}-d{2}-d{4}$ 111-11-1111 Validates the format, type, and length of the supplied input field. The input must consist of 3 numeric characters followed by a dash, then 2 numeric characters followed by a dash, and then 4 numeric characters. Phone Number ^[01]?[- .]?(([2-9]d{2})|[2- 9]d{2})[- .]?d{3}[- .]?d{4}$ (425) 555-0123 Validates a U.S. phone number. It must consist of 3 numeric characters, optionally enclosed in parentheses, followed by a set of 3 numeric characters and then a set of 4 numeric characters. E-mail ^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~- ]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9- ]+)*$ someone@exampl e.com Validates an e-mail address. (per the HTML5 specification http://www.w3.org/TR/html5/forms.html#valid-e-mail-address). URL ^(ht|f)tp(s?)://[0-9a-zA-Z]([- .w]*[0-9a-zA-Z])*(:(0- 9)*)*(/?)([a-zA-Z0-9- .?,'/+&amp;%$#_]*)?$ http://www.micros oft.com Validates a URL ZIP Code ^(d{5}-d{4}|d{5}|d{9})$|^([a- zA-Z]d[a-zA-Z] d[a-zA-Z]d)$ 12345 Validates a U.S. ZIP Code. The code must consist of 5 or 9 numeric characters. Password (?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a- zA-Z0-9]{8,10})$ Validates a strong password. It must be between 8 and 10 characters, contain at least one digit and one alphabetic character, and must not contain special characters. Non- negative integer ^d+$ 0 Validates that the field contains an integer greater than zero. Currency (non- negative) ^d+(.dd)?$ 1 Validates a positive currency amount. If there is a decimal point, it requires 2 numeric characters after the decimal point. For example, 3.00 is valid but 3.1 is not. Currency (positive or negative) ^(-)?d+(.dd)?$ 1.2 Validates for a positive or negative currency amount. If there is a decimal point, it requires 2 numeric characters after the decimal point.
  • 13. Regular Expressions Regular Expressions is a term used to refer to a pattern-matching technology for processing text Although there is no standards body governing the regular expression language, Perl 5, by virtue of its popularity, has set the standard for regular expression syntax A Regular Expression itself is a string that represents a pattern, encoded using the regular expression language and syntax
  • 14. Regular Expression - Zend $validator = new Zend_Validate_Regex(array('pattern' => '/^Test/'); $validator->isValid("Test"); // returns true $validator->isValid("Testing"); // returns true $validator->isValid("Pest"); // returns false
  • 15. Data Validation Techniques Validates against a regular expression representing the proper expected data format (10 alphanumeric characters) (.NET) using System.Text.RegularExpressions; static bool validateUserFormat(String userName) { bool isValid = false; //Fail by default // Verify that the UserName is 1-10 character alphanumeric isValid = Regex.IsMatch(userName, @"^[A-Za-z0-9]{10}$"); return isValid; }
  • 16. Regular Expressions - assertions Assert a string is 8 or more characters: (?=.{8,}) Assert a string contains at least 1 lowercase letter (zero or more characters followed by a lowercase character): (?=.*[a-z]) Assert a string contains at least 1 uppercase letter (zero or more characters followed by an uppercase character): (?=.*[A-Z]) Assert a string contains at least 1 digit: (?=.*[d]) So if you want to match a string at least 6 characters long, with at least one lower case and at least one uppercase letter you could use something like: ^.*(?=.{6,})(?=.*[a-z])(?=.*[A-Z]).*$
  • 17. Known Good Validation Example Validates against a regular expression representing the proper expected data format (10 alphanumeric characters) (Java) import java.util.regex.*; static boolean validateUserFormat(String userName){ boolean isValid = false; //Fail by default try{ // Verify that the UserName is 10 character alphanumeric if (Pattern.matches(“^[A-Za-z0-9]{10}$”, userName)) isValid=true; } catch(PatternSyntaxException e) { System.out.println(e.getDescription()); } return isValid; }
  • 18. Known Good Example $validator = new Zend_Validate_Alnum(); if ($validator->isValid('Abcd12')) { // value contains only allowed chars } else { // false }
  • 19. Known Good Example - Chains // Create a validator chain and add validators to it $validatorChain = new Zend_Validate(); $validatorChain->addValidator( new Zend_Validate_StringLength(array('min' => 6, 'max' => 12))) ->addValidator(new Zend_Validate_Alnum()); // Validate the username if ($validatorChain->isValid($username)) { // username passed validation } else { // username failed validation; print reasons or whatever….. foreach ($validatorChain->getMessages() as $message) { echo "$messagen"; }
  • 20. Often called "BlackList" validation Data is validated against a list of characters that are deemed to be dangerous or unacceptable Useful for preventing specific characters from being accepted by the application Provides the weakest method of validation against malicious data Susceptible to bypass using various forms of character encoding Known Bad Validation Example: Validating entry into generic text field if ($input !~/[rtn><();+&%’”*|]/)
  • 21. Known Bad Validation Example Validates against a regular expression of known bad input strings (.Net) using System.Text.RegularExpressions; static boolean checkMessage(string messageText){ bool isValid = false; //Fail by default // Verify input doesn’t contain any < , > isValid = !Regex.IsMatch(messageText, @"[><]"); return isValid; }
  • 22. Known Bad Validation Example Validates against a regular expression of known bad input strings (Java) import java.util.regex.*; static boolean checkMessage (string messageText) { boolean isValid = false; //Fail by default try { Pattern P = Pattern.compile (“<|>”, Pattern.CASE_INSENSITIVE | Pattern.MULTILINE); Matcher M = p.matcher(messageText); if (!M.find()) isValid = true; } catch(Exception e) { System.out.println(e.toString()); } return isValid; }
  • 23. Bounds Checking All external input must also be properly validated to ensure that excessively large input is rejected Length checking: A maximum length check should be performed on all incoming application data. Careful about name length! Lokelani Keihanaikukauakahihuliheekahaunaele is a real person! Input that exceeds the appropriate length or size limits must be rejected and not processed by the application Size checking: A maximum size check should be performed on all incoming data files
  • 24. The following code reads a String from a file. Because it uses the readLine() method, it will read an unbounded amount of input until a <newline> (n) charter is read. InputStream Input = inputfileFile.getInputStream(Entry); Reader inpReader = new InputStreamReader(Input); BufferedReader br = new BufferedReader(inpReader); String line = br.readLine(); This could be taken advantage of and cause an OutOfMemoryException or to consume a large amount of memory which shall affect performance and initiate costly garbage collection routines. Bounds Checking – Example Unbounded Reading of a file
  • 25. Bounds checking $validator = new Zend_Validate_StringLength(array('max' => 6)); $validator->isValid("Test"); // returns true $validator->isValid("Testing"); // returns false
  • 26. Bounds checking – File size $upload = new Zend_File_Transfer(); // Limit the size of all files to be uploaded to 40000 bytes $upload->addValidator('FilesSize', false, 40000); // Limit the size of all files to be uploaded to maximum 4MB and mimimum 10kB $upload->addValidator('FilesSize', false, array('min' => '10kB', 'max' => '4MB'));
  • 27. .NET Validator Controls: RequiredFieldValidator, CompareValidator, RangeValidator, RegularExpressionValidator, CustomValidator, ValidateRequest Jakarta Commons Validator: required, mask, range, maxLength, minLength, datatype, date, creditCard, email, regularExpression Native Validation Controls Many development platforms have native validator controls, such as Jakarta and .NET
  • 28. Escaping vs. Rejecting When validating data, one can either reject data failing to meet validation requirements or attempt to “clean” or escape dangerous characters Failed validation attempts should always reject the data to minimise the risk that sanitisation routines will be ineffective or can be bypassed Error messages displayed when rejecting data should specify the proper format for the user to enter appropriate data Error messages should not redisplay the input the user has entered
  • 29. The Problem with Escaping --- Snip --- page_template = request.queryString("page") replace(page_template , "/", "") replace(page_template, "..", "") getFile(page_template) --- End Snip --- http://www.example.com/content/default.jsp?page=info.htm  Page_template = info.htm <- First Pass  Page_template = info.htm <- Second Pass http://www.example.com/content/default.jsp?page=../web.xml  Page_template = .. web.xml <- First Pass  Page_template = web.xml <- Second Pass http://www.example.com/content/default.jsp?page=....//web.xml  Page_template = ....web.xml <- First Pass  Page_template = ..web.xml <- Second Pass
  • 30. Input Based Attacks Malicious user input can be used to launch a variety of attacks against an application. These attacks include, but are not limited to: Parameter Manipulation  Cookie poisoning  Hidden field manipulation Content injection  SQL  HTTP Response Splitting  Operating system calls  Command insertion  XPath Cross site scripting  … Buffer overflows  Format string attacks
  • 31. Parameter Manipulation Applications typically pass parameters that determine what the user can do or see Unauthorised access to application data can be obtained by manipulating parameter values, if record-level authorisation checks are not performed within the application code Many applications tend to pass sensitive parameters back and forth rather than using server session variables to store the information Very common to see this in HTTP cookies “hidden” HTML form fields
  • 32. Parameter Manipulation Database record index numbers are often passed as page parameters to view a specific record If there is a relatively small range of possible index values, sequential parameter values can by cycled to view other records Even-non sequential indexing can be attacked within a small range of potential values Manipulating parameter values can be trivial when other obvious valid Values exist: Username=joe (change to username=mary) Privilege=user (change to privilege=admin) Price=100.00 (change to price=1.00)
  • 33. Testing for Parameter Manipulation Identify areas in the application where records appear to be displayed based on input parameters Attempt to access records using other known valid parameter values For parameter values that seem to fall within a variable range, cycle through the range to search for other valid records Identify all data being passed in hidden fields. Attempt to determine: What the data is being used for Whether use of a hidden field seems appropriate
  • 34. Defenses Against Parameter Manipulation Data that should not be altered should never be passed to the client Always perform validation on the server Use the most restrictive input validation method possible Use Exact Match Validation to verify that parameters values are appropriate for the specific transaction or user’s permission level In situations where a query or hash table lookup is required, Known Good Validation should be used to validate the parameter before performing the lookup Retrieve the information from the client once, validate it and keep it on the server associated with that user’s session
  • 35. Summary Don’t ever trust user input Where possible, use whitelist validation Perform input validation at earliest possible stage Layers of defense Use in-built validator routines

Hinweis der Redaktion

  1. 1
  2. ^ (Caret) Matches at the start of the string the regex pattern is applied to. $ (dollar) Matches at the end of the string the regex pattern is applied to.
  3. Set up a mask for certain types of fields
  4. It’s very difficult to list all known bad input – harder to protect against potential future problems.
  5. Strings – especially in C-based applications Numbers – negative numbers may have unintended consequences .NET Web.config <httpRuntime maxRequestLength="2048" /> C#   if (Upload.PostedFile.ContentLength < 1048576){… J2EE: struts-config.xml: <controller maxFileSize="2M" />