SlideShare a Scribd company logo
Top 10 Bad Coding PracticesTop 10 Bad Coding Practices
Lead to Security ProblemsLead to Security Problems
Narudom Roongsiriwong, CISSPNarudom Roongsiriwong, CISSP
MiSSConf(SP3) Apr 1, 2017MiSSConf(SP3) Apr 1, 2017
Top 10 Bad Coding PracticesTop 10 Bad Coding Practices
Lead to Security ProblemsLead to Security Problems
Narudom Roongsiriwong, CISSPNarudom Roongsiriwong, CISSP
MiSSConf(SP3) Apr 1, 2017MiSSConf(SP3) Apr 1, 2017
WhoAmI
● Lazy Blogger
– Japan, Security, FOSS, Politics, Christian
– http://narudomr.blogspot.com
● Information Security since 1995
● Web Application Development since 1998
● Head of IT Security and Solution Architecture,
Kiatnakin Bank PLC (KKP)
● Consultant for OWASP Thailand Chapter
● Committee Member of Cloud Security Alliance (CSA),
Thailand Chapter
● Consulting Team Member for National e-Payment project
● Contact: narudom@owasp.org
Disclaimer
● The Top 10 list is from code review in my
organization and may not be applied globally.
● Code example in this presentation is mainly in Java.
Specific languages will be notified upon examples
“eval” Function
● Applicable Language: Java, Javascript, Python, Perl,
PHP, Ruby and Interpreted Languages
eval(code_to_be_dynamically_executed);
1
“eval” Function - Security Problems
● Confidentiality: The injected code could access
restricted data / files.
● Access Control: In some cases, injectable code
controls authentication; this may lead to a remote
vulnerability.
● Integrity: Code injection attacks can lead to loss of
data integrity in nearly all cases as the control-plane
data injected is always incidental to data recall or
writing.
● Non-Repudiation: Often the actions performed by
injected control code are unlogged.
● Additionally, code injection can often result in the
execution of arbitrary code. 1
“eval” Function: Reference
● MITRE CWE-95 - CWE-95: Improper Neutralization
of Directives in Dynamically Evaluated Code ('Eval
Injection')
● OWASP Top Ten 2013 Category A3 - Cross-Site
Scripting (XSS)
1
Ignore Exception
class Foo implements Runnable {
  public void run() {
    try {
      Thread.sleep(1000);
    } catch (InterruptedException e) {
      // Ignore
    }
  }
}
2
Ignore Exception - Security Problems
● An attacker could utilize an ignored error condition
to place the system in an unexpected state that
could lead to the execution of unintended logic and
could cause other unintended behavior.
● Many conditions lead to application level DoS
(Denial of Service)
2
Ignore Exception: How to Avoid
● Catch all relevant exceptions.
● Ensure that all exceptions are handled in such a way
that you can be sure of the state of your system at
any given moment.
volatile boolean validFlag = false;
do {
try {
// If requested file does not exist,
// throws FileNotFoundException
// If requested file exists, sets validFlag to true
validFlag = true;
} catch (FileNotFoundException e) {
// Ask the user for a different file name
}
} while (validFlag != true);
// Use the file
2
Ignore Exception: Reference
● CERT, ERR00-J. - Do not suppress or ignore checked
exceptions
2
Throw Generic Exception
● Applicable Language: C++, Java, C# and other .NET
languages
public void doExchange() throws Exception {
…
}
if (s == null) {
throw new RuntimeException("Null String");
}
3
Throw Generic Exception - Security Problems
● Integrity: A caller cannot examine the exception to
determine why it was thrown and consequently
cannot attempt recovery
3
Throw Generic Exception: How to Avoid
● Declares a more specific exception class in the
throws clause of the method
● Methods can throw a specific exception subclassed
from Exception or RuntimeException.
public void doExchange() throws IOException {
…
}
if (s == null) {
throw new NullPointerException
("Null String");
}
3
Throw Generic Exception: Reference
● MITRE, CWE-397 - Declaration of Throws for
Generic Exception
● CERT, ERR07-J. - Do not throw RuntimeException,
Exception, or Throwable
3
Expose Sensitive Data or Debug Statement
● Debug statements are always useful during
development.
● But include them in production code - particularly in
code that runs client-side - and you run the risk of
inadvertently exposing sensitive information.
private void DoSomething ()
{
// ...
Console.WriteLine
("so far, so good...");
// ...
}
4
C#
Expose Sensitive Data or Debug Statement:
Security Problems
● In some cases the error message tells the attacker
precisely what sort of an attack the system will be
vulnerable to
4
Expose Sensitive Data or Debug Statement:
How to Avoid
● Do not leave debug statements that could be
executed in the source code
● Do not allow sensitive data to go outside of the
trust boundary and always be careful when
interfacing with a compartment outside of the safe
area
4
Expose Sensitive Data or Debug Statement:
Reference
● OWASP Top Ten 2013 Category A6 - Sensitive Data
Exposure
● MITRE, CWE-215 - Information Exposure Through
Debug Information
4
Compare Floating Point with Normal Operator
● Due to rounding errors, most floating-point
numbers end up being slightly imprecise.
● However, it also means that numbers expected to
be equal (e.g. when calculating the same result
through different correct methods) often differ
slightly, and a simple equality test fails.
float a = 0.15 + 0.15
float b = 0.1 + 0.2
if(a == b) // can be false!
if(a >= b) // can also be false!
5
Compare Floating Point with Normal Operator:
Security Problems
● Integrity: Comparing two floating point numbers to
see if they are equal is usually not what you want
5
Compare Floating Point with Normal Operator:
How to Avoid
● No silver bullet, choose the solution that closes
enough to your intention
● How to compare
– Integer Comparison
bool isEqual = (int)f1 == (int)f2;
bool isEqual = (int)(f1*100) == (int)(f2*100);
// multiply by 100 for 2-digit comparison
– Epsilon Comparison
bool isEqual = fabs(f1 – f2) <= epsilon;
5
Compare Floating Point with Normal Operator:
Reference
● MISRA C:2004, 13.3 - Floating-point expressions
shall not be tested for equality or inequality.
● MISRA C++:2008, 6-2-2 - Floating-point expressions
shall not be directly or indirectly tested for equality
or inequality
5
Not Validate Input
● The software receives input from an upstream
component, but it does not neutralize or incorrectly
neutralizes special elements that could be
interpreted as escape, meta, or control character
sequences when they are sent to a downstream
component.
6
Not Validate Input: Security Problems
● As data is parsed, an injected/absent/malformed
delimiter may cause the process to take unexpected
actions
6
Not Validate Input: How to Avoid
● Assume all input is malicious.
● Use an "accept known good" input validation
strategy, i.e., use a whitelist of acceptable inputs
that strictly conform to specifications.
● Reject any input that does not strictly conform to
specifications, or transform it into something that
does
6
Not Validate Input: Reference
● OWASP Top Ten 2013 Category A1 - Injection
● OWASP Top Ten 2013 Category A3 - Cross-Site
Scripting (XSS)
6
Dereference to Null Object
● Occurs when the application dereferences a pointer
that it expects to be valid, but is NULL or disposed
● 3 major cases are
– Using an improperly initialized pointer
– Using a pointer without checking the return value
– Using a pointer to destroyed or disposed object
● Applicable Language: C, C++, Java, C# and other
.NET languages
7
Using An Improperly Initialized Pointer
7
private User user;
public void someMethod() {
// Do something interesting.
...
// Throws NPE if user hasn't been properly initialized.
String username = user.getName();
}
What will “username” is?
Using a Pointer Without Checking the Return Value
String cmd = System.getProperty("cmd");
cmd = cmd.trim();
What if no property “cmd”?
7
Using a Pointer to Destroyed Or Disposed Object
public FileStream WriteToFile(string path,
string text)
{
using (var fs = File.Create(path))
{
var bytes = Encoding.UTF8.GetBytes(text);
fs.Write(bytes, 0, bytes.Length);
return fs;
}
}
What will be returned?
C#
7
Dereference to Null Object: Security Problems
● Availability: Failure of the process unless exception
handling (on some platforms) is available, very
difficult to return the software to a safe state of
operation.
● Integrity: In some circumstances and environments,
code execution is possible but when the memory
resource is limited and reused, errors may occur.
7
Dereference to Null Object: How to Avoid
● Checking the return value of the function will
typically be sufficient, however beware of race
conditions (CWE-362) in a concurrent environment.
●
● This solution does not handle the use of improperly
initialized variables (CWE-665).
7
Dereference to Null Object: Reference
● MITRE, CWE-476 - NULL Pointer Dereference
● CERT, EXP34-C. - Do not dereference null pointers
● CERT, EXP01-J. - Do not use a null in a case where an
object is required
7
Not Use Parameterized Query
String query = "SELECT * FROM accounts WHERE
custID='" + request.getParameter("id") + "'";
http://example.com/app/accountView?id=' or
'1'='1
8
Not Use Parameterized Query :
Security Problems
● SQL Injection is one of the most dangerous web
vulnerabilities. So much so that it's the #1 item in
the OWASP Top 10.
● It represents a serious threat because SQL Injection
allows evil attacker code to change the structure of
a web application's SQL statement in a way that can
– Steal data
– Modify data
– Potentially facilitate command injection to the
underlying OS
8
What is Parameterized Query?
● Prepared statements with variable binding
● All developers should first be taught how to write
database queries.
● Parameterized queries force the developer to first
define all the SQL code, and then pass in each
parameter to the query later.
● This coding style allows the database to distinguish
between code and data, regardless of what user
input is supplied.
● Prepared statements ensure that an attacker is not
able to change the intent of a query, even if SQL
commands are inserted by an attacker.
8
Safe Java Parameterized Query Example
String custname = request.getParameter("customerName");
String query = "SELECT account_balance FROM user_data WHERE
user_name = ? ";
PreparedStatement pstmt = connection.prepareStatement(query);
pstmt.setString(1, custname);
ResultSet results = pstmt.executeQuery( );
8
Safe C# .NET Parameterized Query Example
String query = "SELECT account_balance FROM user_data
WHERE user_name = ?";
try {
OleDbCommand cmd = new OleDbCommand(query, conn);
cmd.Parameters.Add(new OleDbParameter("customerName",
CustomerName Name.Text));
OleDbDataReader reader = cmd.ExecuteReader();
// …
} catch (OleDbException se) {
// error handling
}
8
Not Use Parameterized Query: Reference
● MITRE, CWE-89 - Improper Neutralization of Special
Elements used in an SQL Command
● MITRE, CWE-564 - SQL Injection: Hibernate
● MITRE, CWE-20 - Improper Input Validation
● MITRE, CWE-943 - Improper Neutralization of
Special Elements in Data Query Logic
● CERT, IDS00-J. - Prevent SQL injection
● OWASP Top Ten 2013 Category A1 - Injection
● SANS Top 25 - Insecure Interaction Between
Components
8
Hard-Coded Credentials
public final Connection getConnection()
throws SQLException {
return DriverManager.getConnection(
"jdbc:mysql://localhost/dbName",
"username", "password");
}
9
Hard-Coded Credentials: Security Problems
● If an attacker can reverse-engineer a software and
see the hard-coded credential, he/she can break
any systems those contain that software
● Client-side systems with hard-coded credentials
propose even more of a threat, since the extraction
of a credential from a binary is exceedingly simple.
9
9) Hard-Coded Credentials: Reference
● MITRE, CWE-798 - Use of Hard-coded Credentials
● MITRE, CWE-259 - Use of Hard-coded Password
● SANS Top 25 - Porous Defenses
● CERT, MSC03-J. - Never hard code sensitive
information
● OWASP Top Ten 2013 Category A2 - Broken
Authentication and Session Management
9
Back-Door or Secret Page
● Developers may add "back door" code for
debugging or testing (or misuse) purposes that is
not intended to be deployed with the application.
● These create security risks because they are not
considered during design or testing and fall outside
of the expected operating conditions of the
application.
10
Back-Door or Secret Page: Security Problems
● The severity of the exposed debug application will
depend on the particular instance.
● It will give an attacker sensitive information about
the settings and mechanics of web applications on
the server
● At worst, as is often the case, it will allow an
attacker complete control over the web application
and server, as well as confidential information that
either of these access.
10
Back-Door or Secret Page: Reference
● MITRE, CWE-489 - Leftover Debug Code
10
Top 10 Bad Coding Practice
1. “eval” Function
2. Ignore Exception
3. Throw Generic Exception
4. Expose Sensitive Data or Debug Statement
5. Compare Floating Point with Normal Operator
6. Not validate Input
7. Dereference to Null Object
8. Not Use Parameterized Query
9. Hard-Coded Credentials
10. Back-Door or Secret Page
Top 10 Bad Coding Practices Lead to Security Problems

More Related Content

What's hot

Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
Anurag Srivastava
 
A Forgotten HTTP Invisibility Cloak
A Forgotten HTTP Invisibility CloakA Forgotten HTTP Invisibility Cloak
A Forgotten HTTP Invisibility Cloak
Soroush Dalili
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...
Noppadol Songsakaew
 
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
 
Xss attack
Xss attackXss attack
Xss attack
Manjushree Mashal
 
SQL Injection
SQL Injection SQL Injection
SQL Injection
Adhoura Academy
 
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
Marco Balduzzi
 
Code injection
Code injectionCode injection
Code injection
Gayatri Patel
 
Neat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionNeat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protection
Mikhail Egorov
 
Directory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion AttacksDirectory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion Attacks
Raghav Bisht
 
Secure Coding principles by example: Build Security In from the start - Carlo...
Secure Coding principles by example: Build Security In from the start - Carlo...Secure Coding principles by example: Build Security In from the start - Carlo...
Secure Coding principles by example: Build Security In from the start - Carlo...
Codemotion
 
SSL Communication and Mutual Authentication
SSL Communication and Mutual AuthenticationSSL Communication and Mutual Authentication
SSL Communication and Mutual Authentication
Cleo
 
Injection flaws
Injection flawsInjection flaws
Injection flaws
DANISH INAMDAR
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
bilcorry
 
Secure coding practices
Secure coding practicesSecure coding practices
Secure coding practices
Scott Hurrey
 
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
Security Innovation
 
Hackfest presentation.pptx
Hackfest presentation.pptxHackfest presentation.pptx
Hackfest presentation.pptx
Peter Yaworski
 
Web application security & Testing
Web application security  & TestingWeb application security  & Testing
Web application security & Testing
Deepu S Nath
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
Avinash Thapa
 
XXE - XML External Entity Attack
XXE - XML External Entity Attack	XXE - XML External Entity Attack
XXE - XML External Entity Attack
Cysinfo Cyber Security Community
 

What's hot (20)

Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
 
A Forgotten HTTP Invisibility Cloak
A Forgotten HTTP Invisibility CloakA Forgotten HTTP Invisibility Cloak
A Forgotten HTTP Invisibility Cloak
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...
 
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)
 
Xss attack
Xss attackXss attack
Xss attack
 
SQL Injection
SQL Injection SQL Injection
SQL Injection
 
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
 
Code injection
Code injectionCode injection
Code injection
 
Neat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionNeat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protection
 
Directory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion AttacksDirectory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion Attacks
 
Secure Coding principles by example: Build Security In from the start - Carlo...
Secure Coding principles by example: Build Security In from the start - Carlo...Secure Coding principles by example: Build Security In from the start - Carlo...
Secure Coding principles by example: Build Security In from the start - Carlo...
 
SSL Communication and Mutual Authentication
SSL Communication and Mutual AuthenticationSSL Communication and Mutual Authentication
SSL Communication and Mutual Authentication
 
Injection flaws
Injection flawsInjection flaws
Injection flaws
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
 
Secure coding practices
Secure coding practicesSecure coding practices
Secure coding practices
 
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
 
Hackfest presentation.pptx
Hackfest presentation.pptxHackfest presentation.pptx
Hackfest presentation.pptx
 
Web application security & Testing
Web application security  & TestingWeb application security  & Testing
Web application security & Testing
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
 
XXE - XML External Entity Attack
XXE - XML External Entity Attack	XXE - XML External Entity Attack
XXE - XML External Entity Attack
 

Viewers also liked

Security Management ของโรงพยาบาลไทย: เมื่อไรจะไล่ทัน Sector อื่น?
Security Management ของโรงพยาบาลไทย: เมื่อไรจะไล่ทัน Sector อื่น?Security Management ของโรงพยาบาลไทย: เมื่อไรจะไล่ทัน Sector อื่น?
Security Management ของโรงพยาบาลไทย: เมื่อไรจะไล่ทัน Sector อื่น?
Nawanan Theera-Ampornpunt
 
OWASP Top 10 Proactive Control 2016 (C5-C10)
OWASP Top 10 Proactive Control 2016 (C5-C10)OWASP Top 10 Proactive Control 2016 (C5-C10)
OWASP Top 10 Proactive Control 2016 (C5-C10)
Narudom Roongsiriwong, CISSP
 
Securing the Internet from Cyber Criminals
Securing the Internet from Cyber CriminalsSecuring the Internet from Cyber Criminals
Securing the Internet from Cyber Criminals
Narudom Roongsiriwong, CISSP
 
AnyID: Security Point of View
AnyID: Security Point of ViewAnyID: Security Point of View
AnyID: Security Point of View
Narudom Roongsiriwong, CISSP
 
Application Security: Last Line of Defense
Application Security: Last Line of DefenseApplication Security: Last Line of Defense
Application Security: Last Line of Defense
Narudom Roongsiriwong, CISSP
 
Payment Card System Overview
Payment Card System OverviewPayment Card System Overview
Payment Card System Overview
Narudom Roongsiriwong, CISSP
 
"Физика в походе". Повторение темы "Тепловые явления"
"Физика в походе". Повторение темы "Тепловые явления""Физика в походе". Повторение темы "Тепловые явления"
"Физика в походе". Повторение темы "Тепловые явления"
sveta7940
 
Презентація: Фізика і криміналістика
Презентація: Фізика і криміналістикаПрезентація: Фізика і криміналістика
Презентація: Фізика і криміналістика
sveta7940
 
Презентація:Ознаки рівності трикутників
Презентація:Ознаки рівності трикутниківПрезентація:Ознаки рівності трикутників
Презентація:Ознаки рівності трикутників
sveta7940
 
Презентація:Фізика в прислів"ях, приказках, загадках
Презентація:Фізика в прислів"ях, приказках, загадкахПрезентація:Фізика в прислів"ях, приказках, загадках
Презентація:Фізика в прислів"ях, приказках, загадках
sveta7940
 
Презентация:Физика в походе.
Презентация:Физика в походе. Презентация:Физика в походе.
Презентация:Физика в походе.
sveta7940
 
Задачи по теме "Тепловые явления"
Задачи по теме "Тепловые явления"Задачи по теме "Тепловые явления"
Задачи по теме "Тепловые явления"
sveta7940
 
КВН по теме "Тепловые явления"
КВН по теме "Тепловые явления"КВН по теме "Тепловые явления"
КВН по теме "Тепловые явления"
sveta7940
 
Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...
Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...
Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...
StorageCraft Benelux
 
Secure PHP Coding
Secure PHP CodingSecure PHP Coding
Secure PHP Coding
Narudom Roongsiriwong, CISSP
 
El Valor de construir First Party Data Orgánico a través del Ecosistema Digit...
El Valor de construir First Party Data Orgánico a través del Ecosistema Digit...El Valor de construir First Party Data Orgánico a través del Ecosistema Digit...
El Valor de construir First Party Data Orgánico a través del Ecosistema Digit...
Esther Checa
 
Information system managment disaster recovery
Information system managment disaster recoveryInformation system managment disaster recovery
Information system managment disaster recovery
Ravi Singh Shekhawat
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster Recovery
MongoDB
 
Unlock Security Insight from Machine Data
Unlock Security Insight from Machine DataUnlock Security Insight from Machine Data
Unlock Security Insight from Machine Data
Narudom Roongsiriwong, CISSP
 

Viewers also liked (20)

Security Management ของโรงพยาบาลไทย: เมื่อไรจะไล่ทัน Sector อื่น?
Security Management ของโรงพยาบาลไทย: เมื่อไรจะไล่ทัน Sector อื่น?Security Management ของโรงพยาบาลไทย: เมื่อไรจะไล่ทัน Sector อื่น?
Security Management ของโรงพยาบาลไทย: เมื่อไรจะไล่ทัน Sector อื่น?
 
OWASP Top 10 Proactive Control 2016 (C5-C10)
OWASP Top 10 Proactive Control 2016 (C5-C10)OWASP Top 10 Proactive Control 2016 (C5-C10)
OWASP Top 10 Proactive Control 2016 (C5-C10)
 
Securing the Internet from Cyber Criminals
Securing the Internet from Cyber CriminalsSecuring the Internet from Cyber Criminals
Securing the Internet from Cyber Criminals
 
AnyID: Security Point of View
AnyID: Security Point of ViewAnyID: Security Point of View
AnyID: Security Point of View
 
Application Security: Last Line of Defense
Application Security: Last Line of DefenseApplication Security: Last Line of Defense
Application Security: Last Line of Defense
 
Payment Card System Overview
Payment Card System OverviewPayment Card System Overview
Payment Card System Overview
 
Python Course #1
Python Course #1Python Course #1
Python Course #1
 
"Физика в походе". Повторение темы "Тепловые явления"
"Физика в походе". Повторение темы "Тепловые явления""Физика в походе". Повторение темы "Тепловые явления"
"Физика в походе". Повторение темы "Тепловые явления"
 
Презентація: Фізика і криміналістика
Презентація: Фізика і криміналістикаПрезентація: Фізика і криміналістика
Презентація: Фізика і криміналістика
 
Презентація:Ознаки рівності трикутників
Презентація:Ознаки рівності трикутниківПрезентація:Ознаки рівності трикутників
Презентація:Ознаки рівності трикутників
 
Презентація:Фізика в прислів"ях, приказках, загадках
Презентація:Фізика в прислів"ях, приказках, загадкахПрезентація:Фізика в прислів"ях, приказках, загадках
Презентація:Фізика в прислів"ях, приказках, загадках
 
Презентация:Физика в походе.
Презентация:Физика в походе. Презентация:Физика в походе.
Презентация:Физика в походе.
 
Задачи по теме "Тепловые явления"
Задачи по теме "Тепловые явления"Задачи по теме "Тепловые явления"
Задачи по теме "Тепловые явления"
 
КВН по теме "Тепловые явления"
КВН по теме "Тепловые явления"КВН по теме "Тепловые явления"
КВН по теме "Тепловые явления"
 
Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...
Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...
Slide presentation storage_craft_backup_disaster_recovery_for_microsoft_syste...
 
Secure PHP Coding
Secure PHP CodingSecure PHP Coding
Secure PHP Coding
 
El Valor de construir First Party Data Orgánico a través del Ecosistema Digit...
El Valor de construir First Party Data Orgánico a través del Ecosistema Digit...El Valor de construir First Party Data Orgánico a través del Ecosistema Digit...
El Valor de construir First Party Data Orgánico a través del Ecosistema Digit...
 
Information system managment disaster recovery
Information system managment disaster recoveryInformation system managment disaster recovery
Information system managment disaster recovery
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster Recovery
 
Unlock Security Insight from Machine Data
Unlock Security Insight from Machine DataUnlock Security Insight from Machine Data
Unlock Security Insight from Machine Data
 

Similar to Top 10 Bad Coding Practices Lead to Security Problems

Survey Presentation About Application Security
Survey Presentation About Application SecuritySurvey Presentation About Application Security
Survey Presentation About Application Security
Nicholas Davis
 
Cypress Best Pratices for Test Automation
Cypress Best Pratices for Test AutomationCypress Best Pratices for Test Automation
Cypress Best Pratices for Test Automation
Knoldus Inc.
 
Mobile security recipes for xamarin
Mobile security recipes for xamarinMobile security recipes for xamarin
Mobile security recipes for xamarin
Nicolas Milcoff
 
Application Security - Your Success Depends on it
Application Security - Your Success Depends on itApplication Security - Your Success Depends on it
Application Security - Your Success Depends on it
WSO2
 
Agile Secure Development
Agile Secure DevelopmentAgile Secure Development
Agile Secure Development
Bosnia Agile
 
Secure coding - Balgan - Tiago Henriques
Secure coding - Balgan - Tiago HenriquesSecure coding - Balgan - Tiago Henriques
Secure coding - Balgan - Tiago Henriques
Tiago Henriques
 
Building Efficient Software with Property Based Testing
Building Efficient Software with Property Based TestingBuilding Efficient Software with Property Based Testing
Building Efficient Software with Property Based Testing
CitiusTech
 
Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10
Barry Dorrans
 
Threat Modeling for Web Applications (and other duties as assigned)
Threat Modeling for Web Applications (and other duties as assigned)Threat Modeling for Web Applications (and other duties as assigned)
Threat Modeling for Web Applications (and other duties as assigned)
Mike Tetreault
 
Java application security the hard way - a workshop for the serious developer
Java application security the hard way - a workshop for the serious developerJava application security the hard way - a workshop for the serious developer
Java application security the hard way - a workshop for the serious developer
Steve Poole
 
Conf2014_SplunkSecurityNinjutsu
Conf2014_SplunkSecurityNinjutsuConf2014_SplunkSecurityNinjutsu
Conf2014_SplunkSecurityNinjutsu
Splunk
 
OWASP Top 10 - 2017 Top 10 web application security risks
OWASP Top 10 - 2017 Top 10 web application security risksOWASP Top 10 - 2017 Top 10 web application security risks
OWASP Top 10 - 2017 Top 10 web application security risks
Kun-Da Wu
 
Secure develpment 2014
Secure develpment 2014Secure develpment 2014
Secure develpment 2014
Ariel Evans
 
How to Destroy a Database
How to Destroy a DatabaseHow to Destroy a Database
How to Destroy a Database
John Ashmead
 
Security engineering 101 when good design & security work together
Security engineering 101  when good design & security work togetherSecurity engineering 101  when good design & security work together
Security engineering 101 when good design & security work together
Wendy Knox Everette
 
Security .NET.pdf
Security .NET.pdfSecurity .NET.pdf
Security .NET.pdf
Abhi Jain
 
Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020
Moataz Kamel
 
Applying formal methods to existing software by B.Monate
Applying formal methods to existing software by B.MonateApplying formal methods to existing software by B.Monate
Applying formal methods to existing software by B.Monate
Mahaut Gouhier
 
How to secure your web applications with NGINX
How to secure your web applications with NGINXHow to secure your web applications with NGINX
How to secure your web applications with NGINX
Wallarm
 
Open Source and Secure Coding Practices
Open Source and Secure Coding PracticesOpen Source and Secure Coding Practices
Open Source and Secure Coding Practices
All Things Open
 

Similar to Top 10 Bad Coding Practices Lead to Security Problems (20)

Survey Presentation About Application Security
Survey Presentation About Application SecuritySurvey Presentation About Application Security
Survey Presentation About Application Security
 
Cypress Best Pratices for Test Automation
Cypress Best Pratices for Test AutomationCypress Best Pratices for Test Automation
Cypress Best Pratices for Test Automation
 
Mobile security recipes for xamarin
Mobile security recipes for xamarinMobile security recipes for xamarin
Mobile security recipes for xamarin
 
Application Security - Your Success Depends on it
Application Security - Your Success Depends on itApplication Security - Your Success Depends on it
Application Security - Your Success Depends on it
 
Agile Secure Development
Agile Secure DevelopmentAgile Secure Development
Agile Secure Development
 
Secure coding - Balgan - Tiago Henriques
Secure coding - Balgan - Tiago HenriquesSecure coding - Balgan - Tiago Henriques
Secure coding - Balgan - Tiago Henriques
 
Building Efficient Software with Property Based Testing
Building Efficient Software with Property Based TestingBuilding Efficient Software with Property Based Testing
Building Efficient Software with Property Based Testing
 
Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10Don't get stung - an introduction to the OWASP Top 10
Don't get stung - an introduction to the OWASP Top 10
 
Threat Modeling for Web Applications (and other duties as assigned)
Threat Modeling for Web Applications (and other duties as assigned)Threat Modeling for Web Applications (and other duties as assigned)
Threat Modeling for Web Applications (and other duties as assigned)
 
Java application security the hard way - a workshop for the serious developer
Java application security the hard way - a workshop for the serious developerJava application security the hard way - a workshop for the serious developer
Java application security the hard way - a workshop for the serious developer
 
Conf2014_SplunkSecurityNinjutsu
Conf2014_SplunkSecurityNinjutsuConf2014_SplunkSecurityNinjutsu
Conf2014_SplunkSecurityNinjutsu
 
OWASP Top 10 - 2017 Top 10 web application security risks
OWASP Top 10 - 2017 Top 10 web application security risksOWASP Top 10 - 2017 Top 10 web application security risks
OWASP Top 10 - 2017 Top 10 web application security risks
 
Secure develpment 2014
Secure develpment 2014Secure develpment 2014
Secure develpment 2014
 
How to Destroy a Database
How to Destroy a DatabaseHow to Destroy a Database
How to Destroy a Database
 
Security engineering 101 when good design & security work together
Security engineering 101  when good design & security work togetherSecurity engineering 101  when good design & security work together
Security engineering 101 when good design & security work together
 
Security .NET.pdf
Security .NET.pdfSecurity .NET.pdf
Security .NET.pdf
 
Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020Secure coding presentation Oct 3 2020
Secure coding presentation Oct 3 2020
 
Applying formal methods to existing software by B.Monate
Applying formal methods to existing software by B.MonateApplying formal methods to existing software by B.Monate
Applying formal methods to existing software by B.Monate
 
How to secure your web applications with NGINX
How to secure your web applications with NGINXHow to secure your web applications with NGINX
How to secure your web applications with NGINX
 
Open Source and Secure Coding Practices
Open Source and Secure Coding PracticesOpen Source and Secure Coding Practices
Open Source and Secure Coding Practices
 

More from Narudom Roongsiriwong, CISSP

Biometric Authentication.pdf
Biometric Authentication.pdfBiometric Authentication.pdf
Biometric Authentication.pdf
Narudom Roongsiriwong, CISSP
 
Security Shift Leftmost - Secure Architecture.pdf
Security Shift Leftmost - Secure Architecture.pdfSecurity Shift Leftmost - Secure Architecture.pdf
Security Shift Leftmost - Secure Architecture.pdf
Narudom Roongsiriwong, CISSP
 
Secure Design: Threat Modeling
Secure Design: Threat ModelingSecure Design: Threat Modeling
Secure Design: Threat Modeling
Narudom Roongsiriwong, CISSP
 
Security Patterns for Software Development
Security Patterns for Software DevelopmentSecurity Patterns for Software Development
Security Patterns for Software Development
Narudom Roongsiriwong, CISSP
 
How Good Security Architecture Saves Corporate Workers from COVID-19
How Good Security Architecture Saves Corporate Workers from COVID-19How Good Security Architecture Saves Corporate Workers from COVID-19
How Good Security Architecture Saves Corporate Workers from COVID-19
Narudom Roongsiriwong, CISSP
 
Secure Software Design for Data Privacy
Secure Software Design for Data PrivacySecure Software Design for Data Privacy
Secure Software Design for Data Privacy
Narudom Roongsiriwong, CISSP
 
Blockchain and Cryptocurrency for Dummies
Blockchain and Cryptocurrency for DummiesBlockchain and Cryptocurrency for Dummies
Blockchain and Cryptocurrency for Dummies
Narudom Roongsiriwong, CISSP
 
DevSecOps 101
DevSecOps 101DevSecOps 101
National Digital ID Platform Technical Forum
National Digital ID Platform Technical ForumNational Digital ID Platform Technical Forum
National Digital ID Platform Technical Forum
Narudom Roongsiriwong, CISSP
 
IoT Security
IoT SecurityIoT Security
Embedded System Security: Learning from Banking and Payment Industry
Embedded System Security: Learning from Banking and Payment IndustryEmbedded System Security: Learning from Banking and Payment Industry
Embedded System Security: Learning from Banking and Payment Industry
Narudom Roongsiriwong, CISSP
 
Secure Your Encryption with HSM
Secure Your Encryption with HSMSecure Your Encryption with HSM
Secure Your Encryption with HSM
Narudom Roongsiriwong, CISSP
 
Application Security Verification Standard Project
Application Security Verification Standard ProjectApplication Security Verification Standard Project
Application Security Verification Standard Project
Narudom Roongsiriwong, CISSP
 
Coding Security: Code Mania 101
Coding Security: Code Mania 101Coding Security: Code Mania 101
Coding Security: Code Mania 101
Narudom Roongsiriwong, CISSP
 
Secure Code Review 101
Secure Code Review 101Secure Code Review 101
Secure Code Review 101
Narudom Roongsiriwong, CISSP
 
Secure Software Development Adoption Strategy
Secure Software Development Adoption StrategySecure Software Development Adoption Strategy
Secure Software Development Adoption Strategy
Narudom Roongsiriwong, CISSP
 
AnyID and Privacy
AnyID and PrivacyAnyID and Privacy
AnyID and Privacy
Narudom Roongsiriwong, CISSP
 
OWASP Top 10 A4 – Insecure Direct Object Reference
OWASP Top 10 A4 – Insecure Direct Object ReferenceOWASP Top 10 A4 – Insecure Direct Object Reference
OWASP Top 10 A4 – Insecure Direct Object Reference
Narudom Roongsiriwong, CISSP
 
Database Firewall with Snort
Database Firewall with SnortDatabase Firewall with Snort
Database Firewall with Snort
Narudom Roongsiriwong, CISSP
 
Business continuity & disaster recovery planning (BCP & DRP)
Business continuity & disaster recovery planning (BCP & DRP)Business continuity & disaster recovery planning (BCP & DRP)
Business continuity & disaster recovery planning (BCP & DRP)
Narudom Roongsiriwong, CISSP
 

More from Narudom Roongsiriwong, CISSP (20)

Biometric Authentication.pdf
Biometric Authentication.pdfBiometric Authentication.pdf
Biometric Authentication.pdf
 
Security Shift Leftmost - Secure Architecture.pdf
Security Shift Leftmost - Secure Architecture.pdfSecurity Shift Leftmost - Secure Architecture.pdf
Security Shift Leftmost - Secure Architecture.pdf
 
Secure Design: Threat Modeling
Secure Design: Threat ModelingSecure Design: Threat Modeling
Secure Design: Threat Modeling
 
Security Patterns for Software Development
Security Patterns for Software DevelopmentSecurity Patterns for Software Development
Security Patterns for Software Development
 
How Good Security Architecture Saves Corporate Workers from COVID-19
How Good Security Architecture Saves Corporate Workers from COVID-19How Good Security Architecture Saves Corporate Workers from COVID-19
How Good Security Architecture Saves Corporate Workers from COVID-19
 
Secure Software Design for Data Privacy
Secure Software Design for Data PrivacySecure Software Design for Data Privacy
Secure Software Design for Data Privacy
 
Blockchain and Cryptocurrency for Dummies
Blockchain and Cryptocurrency for DummiesBlockchain and Cryptocurrency for Dummies
Blockchain and Cryptocurrency for Dummies
 
DevSecOps 101
DevSecOps 101DevSecOps 101
DevSecOps 101
 
National Digital ID Platform Technical Forum
National Digital ID Platform Technical ForumNational Digital ID Platform Technical Forum
National Digital ID Platform Technical Forum
 
IoT Security
IoT SecurityIoT Security
IoT Security
 
Embedded System Security: Learning from Banking and Payment Industry
Embedded System Security: Learning from Banking and Payment IndustryEmbedded System Security: Learning from Banking and Payment Industry
Embedded System Security: Learning from Banking and Payment Industry
 
Secure Your Encryption with HSM
Secure Your Encryption with HSMSecure Your Encryption with HSM
Secure Your Encryption with HSM
 
Application Security Verification Standard Project
Application Security Verification Standard ProjectApplication Security Verification Standard Project
Application Security Verification Standard Project
 
Coding Security: Code Mania 101
Coding Security: Code Mania 101Coding Security: Code Mania 101
Coding Security: Code Mania 101
 
Secure Code Review 101
Secure Code Review 101Secure Code Review 101
Secure Code Review 101
 
Secure Software Development Adoption Strategy
Secure Software Development Adoption StrategySecure Software Development Adoption Strategy
Secure Software Development Adoption Strategy
 
AnyID and Privacy
AnyID and PrivacyAnyID and Privacy
AnyID and Privacy
 
OWASP Top 10 A4 – Insecure Direct Object Reference
OWASP Top 10 A4 – Insecure Direct Object ReferenceOWASP Top 10 A4 – Insecure Direct Object Reference
OWASP Top 10 A4 – Insecure Direct Object Reference
 
Database Firewall with Snort
Database Firewall with SnortDatabase Firewall with Snort
Database Firewall with Snort
 
Business continuity & disaster recovery planning (BCP & DRP)
Business continuity & disaster recovery planning (BCP & DRP)Business continuity & disaster recovery planning (BCP & DRP)
Business continuity & disaster recovery planning (BCP & DRP)
 

Recently uploaded

Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
The Third Creative Media
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
kalichargn70th171
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 

Recently uploaded (20)

Kubernetes at Scale: Going Multi-Cluster with Istio
Kubernetes at Scale:  Going Multi-Cluster  with IstioKubernetes at Scale:  Going Multi-Cluster  with Istio
Kubernetes at Scale: Going Multi-Cluster with Istio
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
Unlock the Secrets to Effortless Video Creation with Invideo: Your Ultimate G...
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 

Top 10 Bad Coding Practices Lead to Security Problems

  • 1. Top 10 Bad Coding PracticesTop 10 Bad Coding Practices Lead to Security ProblemsLead to Security Problems Narudom Roongsiriwong, CISSPNarudom Roongsiriwong, CISSP MiSSConf(SP3) Apr 1, 2017MiSSConf(SP3) Apr 1, 2017 Top 10 Bad Coding PracticesTop 10 Bad Coding Practices Lead to Security ProblemsLead to Security Problems Narudom Roongsiriwong, CISSPNarudom Roongsiriwong, CISSP MiSSConf(SP3) Apr 1, 2017MiSSConf(SP3) Apr 1, 2017
  • 2. WhoAmI ● Lazy Blogger – Japan, Security, FOSS, Politics, Christian – http://narudomr.blogspot.com ● Information Security since 1995 ● Web Application Development since 1998 ● Head of IT Security and Solution Architecture, Kiatnakin Bank PLC (KKP) ● Consultant for OWASP Thailand Chapter ● Committee Member of Cloud Security Alliance (CSA), Thailand Chapter ● Consulting Team Member for National e-Payment project ● Contact: narudom@owasp.org
  • 3. Disclaimer ● The Top 10 list is from code review in my organization and may not be applied globally. ● Code example in this presentation is mainly in Java. Specific languages will be notified upon examples
  • 4. “eval” Function ● Applicable Language: Java, Javascript, Python, Perl, PHP, Ruby and Interpreted Languages eval(code_to_be_dynamically_executed); 1
  • 5. “eval” Function - Security Problems ● Confidentiality: The injected code could access restricted data / files. ● Access Control: In some cases, injectable code controls authentication; this may lead to a remote vulnerability. ● Integrity: Code injection attacks can lead to loss of data integrity in nearly all cases as the control-plane data injected is always incidental to data recall or writing. ● Non-Repudiation: Often the actions performed by injected control code are unlogged. ● Additionally, code injection can often result in the execution of arbitrary code. 1
  • 6. “eval” Function: Reference ● MITRE CWE-95 - CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') ● OWASP Top Ten 2013 Category A3 - Cross-Site Scripting (XSS) 1
  • 7. Ignore Exception class Foo implements Runnable {   public void run() {     try {       Thread.sleep(1000);     } catch (InterruptedException e) {       // Ignore     }   } } 2
  • 8. Ignore Exception - Security Problems ● An attacker could utilize an ignored error condition to place the system in an unexpected state that could lead to the execution of unintended logic and could cause other unintended behavior. ● Many conditions lead to application level DoS (Denial of Service) 2
  • 9. Ignore Exception: How to Avoid ● Catch all relevant exceptions. ● Ensure that all exceptions are handled in such a way that you can be sure of the state of your system at any given moment. volatile boolean validFlag = false; do { try { // If requested file does not exist, // throws FileNotFoundException // If requested file exists, sets validFlag to true validFlag = true; } catch (FileNotFoundException e) { // Ask the user for a different file name } } while (validFlag != true); // Use the file 2
  • 10. Ignore Exception: Reference ● CERT, ERR00-J. - Do not suppress or ignore checked exceptions 2
  • 11. Throw Generic Exception ● Applicable Language: C++, Java, C# and other .NET languages public void doExchange() throws Exception { … } if (s == null) { throw new RuntimeException("Null String"); } 3
  • 12. Throw Generic Exception - Security Problems ● Integrity: A caller cannot examine the exception to determine why it was thrown and consequently cannot attempt recovery 3
  • 13. Throw Generic Exception: How to Avoid ● Declares a more specific exception class in the throws clause of the method ● Methods can throw a specific exception subclassed from Exception or RuntimeException. public void doExchange() throws IOException { … } if (s == null) { throw new NullPointerException ("Null String"); } 3
  • 14. Throw Generic Exception: Reference ● MITRE, CWE-397 - Declaration of Throws for Generic Exception ● CERT, ERR07-J. - Do not throw RuntimeException, Exception, or Throwable 3
  • 15. Expose Sensitive Data or Debug Statement ● Debug statements are always useful during development. ● But include them in production code - particularly in code that runs client-side - and you run the risk of inadvertently exposing sensitive information. private void DoSomething () { // ... Console.WriteLine ("so far, so good..."); // ... } 4 C#
  • 16. Expose Sensitive Data or Debug Statement: Security Problems ● In some cases the error message tells the attacker precisely what sort of an attack the system will be vulnerable to 4
  • 17. Expose Sensitive Data or Debug Statement: How to Avoid ● Do not leave debug statements that could be executed in the source code ● Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area 4
  • 18. Expose Sensitive Data or Debug Statement: Reference ● OWASP Top Ten 2013 Category A6 - Sensitive Data Exposure ● MITRE, CWE-215 - Information Exposure Through Debug Information 4
  • 19. Compare Floating Point with Normal Operator ● Due to rounding errors, most floating-point numbers end up being slightly imprecise. ● However, it also means that numbers expected to be equal (e.g. when calculating the same result through different correct methods) often differ slightly, and a simple equality test fails. float a = 0.15 + 0.15 float b = 0.1 + 0.2 if(a == b) // can be false! if(a >= b) // can also be false! 5
  • 20. Compare Floating Point with Normal Operator: Security Problems ● Integrity: Comparing two floating point numbers to see if they are equal is usually not what you want 5
  • 21. Compare Floating Point with Normal Operator: How to Avoid ● No silver bullet, choose the solution that closes enough to your intention ● How to compare – Integer Comparison bool isEqual = (int)f1 == (int)f2; bool isEqual = (int)(f1*100) == (int)(f2*100); // multiply by 100 for 2-digit comparison – Epsilon Comparison bool isEqual = fabs(f1 – f2) <= epsilon; 5
  • 22. Compare Floating Point with Normal Operator: Reference ● MISRA C:2004, 13.3 - Floating-point expressions shall not be tested for equality or inequality. ● MISRA C++:2008, 6-2-2 - Floating-point expressions shall not be directly or indirectly tested for equality or inequality 5
  • 23. Not Validate Input ● The software receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component. 6
  • 24. Not Validate Input: Security Problems ● As data is parsed, an injected/absent/malformed delimiter may cause the process to take unexpected actions 6
  • 25. Not Validate Input: How to Avoid ● Assume all input is malicious. ● Use an "accept known good" input validation strategy, i.e., use a whitelist of acceptable inputs that strictly conform to specifications. ● Reject any input that does not strictly conform to specifications, or transform it into something that does 6
  • 26. Not Validate Input: Reference ● OWASP Top Ten 2013 Category A1 - Injection ● OWASP Top Ten 2013 Category A3 - Cross-Site Scripting (XSS) 6
  • 27. Dereference to Null Object ● Occurs when the application dereferences a pointer that it expects to be valid, but is NULL or disposed ● 3 major cases are – Using an improperly initialized pointer – Using a pointer without checking the return value – Using a pointer to destroyed or disposed object ● Applicable Language: C, C++, Java, C# and other .NET languages 7
  • 28. Using An Improperly Initialized Pointer 7 private User user; public void someMethod() { // Do something interesting. ... // Throws NPE if user hasn't been properly initialized. String username = user.getName(); } What will “username” is?
  • 29. Using a Pointer Without Checking the Return Value String cmd = System.getProperty("cmd"); cmd = cmd.trim(); What if no property “cmd”? 7
  • 30. Using a Pointer to Destroyed Or Disposed Object public FileStream WriteToFile(string path, string text) { using (var fs = File.Create(path)) { var bytes = Encoding.UTF8.GetBytes(text); fs.Write(bytes, 0, bytes.Length); return fs; } } What will be returned? C# 7
  • 31. Dereference to Null Object: Security Problems ● Availability: Failure of the process unless exception handling (on some platforms) is available, very difficult to return the software to a safe state of operation. ● Integrity: In some circumstances and environments, code execution is possible but when the memory resource is limited and reused, errors may occur. 7
  • 32. Dereference to Null Object: How to Avoid ● Checking the return value of the function will typically be sufficient, however beware of race conditions (CWE-362) in a concurrent environment. ● ● This solution does not handle the use of improperly initialized variables (CWE-665). 7
  • 33. Dereference to Null Object: Reference ● MITRE, CWE-476 - NULL Pointer Dereference ● CERT, EXP34-C. - Do not dereference null pointers ● CERT, EXP01-J. - Do not use a null in a case where an object is required 7
  • 34. Not Use Parameterized Query String query = "SELECT * FROM accounts WHERE custID='" + request.getParameter("id") + "'"; http://example.com/app/accountView?id=' or '1'='1 8
  • 35. Not Use Parameterized Query : Security Problems ● SQL Injection is one of the most dangerous web vulnerabilities. So much so that it's the #1 item in the OWASP Top 10. ● It represents a serious threat because SQL Injection allows evil attacker code to change the structure of a web application's SQL statement in a way that can – Steal data – Modify data – Potentially facilitate command injection to the underlying OS 8
  • 36. What is Parameterized Query? ● Prepared statements with variable binding ● All developers should first be taught how to write database queries. ● Parameterized queries force the developer to first define all the SQL code, and then pass in each parameter to the query later. ● This coding style allows the database to distinguish between code and data, regardless of what user input is supplied. ● Prepared statements ensure that an attacker is not able to change the intent of a query, even if SQL commands are inserted by an attacker. 8
  • 37. Safe Java Parameterized Query Example String custname = request.getParameter("customerName"); String query = "SELECT account_balance FROM user_data WHERE user_name = ? "; PreparedStatement pstmt = connection.prepareStatement(query); pstmt.setString(1, custname); ResultSet results = pstmt.executeQuery( ); 8
  • 38. Safe C# .NET Parameterized Query Example String query = "SELECT account_balance FROM user_data WHERE user_name = ?"; try { OleDbCommand cmd = new OleDbCommand(query, conn); cmd.Parameters.Add(new OleDbParameter("customerName", CustomerName Name.Text)); OleDbDataReader reader = cmd.ExecuteReader(); // … } catch (OleDbException se) { // error handling } 8
  • 39. Not Use Parameterized Query: Reference ● MITRE, CWE-89 - Improper Neutralization of Special Elements used in an SQL Command ● MITRE, CWE-564 - SQL Injection: Hibernate ● MITRE, CWE-20 - Improper Input Validation ● MITRE, CWE-943 - Improper Neutralization of Special Elements in Data Query Logic ● CERT, IDS00-J. - Prevent SQL injection ● OWASP Top Ten 2013 Category A1 - Injection ● SANS Top 25 - Insecure Interaction Between Components 8
  • 40. Hard-Coded Credentials public final Connection getConnection() throws SQLException { return DriverManager.getConnection( "jdbc:mysql://localhost/dbName", "username", "password"); } 9
  • 41. Hard-Coded Credentials: Security Problems ● If an attacker can reverse-engineer a software and see the hard-coded credential, he/she can break any systems those contain that software ● Client-side systems with hard-coded credentials propose even more of a threat, since the extraction of a credential from a binary is exceedingly simple. 9
  • 42. 9) Hard-Coded Credentials: Reference ● MITRE, CWE-798 - Use of Hard-coded Credentials ● MITRE, CWE-259 - Use of Hard-coded Password ● SANS Top 25 - Porous Defenses ● CERT, MSC03-J. - Never hard code sensitive information ● OWASP Top Ten 2013 Category A2 - Broken Authentication and Session Management 9
  • 43. Back-Door or Secret Page ● Developers may add "back door" code for debugging or testing (or misuse) purposes that is not intended to be deployed with the application. ● These create security risks because they are not considered during design or testing and fall outside of the expected operating conditions of the application. 10
  • 44. Back-Door or Secret Page: Security Problems ● The severity of the exposed debug application will depend on the particular instance. ● It will give an attacker sensitive information about the settings and mechanics of web applications on the server ● At worst, as is often the case, it will allow an attacker complete control over the web application and server, as well as confidential information that either of these access. 10
  • 45. Back-Door or Secret Page: Reference ● MITRE, CWE-489 - Leftover Debug Code 10
  • 46. Top 10 Bad Coding Practice 1. “eval” Function 2. Ignore Exception 3. Throw Generic Exception 4. Expose Sensitive Data or Debug Statement 5. Compare Floating Point with Normal Operator 6. Not validate Input 7. Dereference to Null Object 8. Not Use Parameterized Query 9. Hard-Coded Credentials 10. Back-Door or Secret Page