SlideShare a Scribd company logo
Secure Coding
Secure coding guidelines
Secure coding guidelines
Injection Prevention Rules
• Rule #1 (Perform proper input validation):
Perform proper input validation. Positive or “whitelist” input validation with appropriate canonicalization is also recommended, but is not a complete defense as many applications require
special characters in their input.
• Rule #2 (Use a safe API):
The preferred option is to use a safe API which avoids the use of the interpreter entirely or provides a parameterized interface. Be careful of APIs, such as stored procedures, that are
parameterized, but can still introduce injection under the hood.
• Rule #3 (Contextually escape user data):
If a parameterized API is not available, you should carefully escape special characters using the specific escape syntax for that interpreter.
• Further reading: https://www.owasp.org/index.php/Injection_Prevention_Cheat_Sheet
Authentication Rules
• Implement Proper Password Strength Controls
• Implement Secure Password Recovery Mechanism
• Store Passwords in a Secure Fashion
• Transmit Passwords Only Over TLS or Other Strong Transport
• Require Re-authentication for Sensitive Features
• An application should respond with a generic error message regardless of whether the user ID or password was incorrect.
• Prevent Brute-Force Attacks by disabling user account after multiple failed logins.
• Enable logging and monitoring of authentication functions to detect attacks
• Further reading: https://www.owasp.org/index.php/Authentication_Cheat_Sheet
Sensitive Data Rules
• Classify data processed, stored or transmitted by application.
• Identify which data is sensitive according to laws, regulation and business needs.
• Dont store sensitive data unnecessarily. Data that is not retained cannot be stolen.
• Make sure to encrypt sensitive data at rest.
• Encrypt all data in transit with secure protocols like TLS
• Disable caching for responses which contain sensitive data.
• Further reading: http://cwe.mitre.org/data/definitions/312.html
Access Control Rules
• Divide the software into anonymous, normal, privileged, and administrative areas. Carefully map roles with data
and functionality.
• Ensure that you perform access control checks related to your business logic.
• Consider using authorization frameworks such as the JAAS Authorization Framework.
• For web applications, make sure that the access control mechanism is enforced correctly at the server side on
every page.
• Use the access control capabilities of your operating system and server environment.
• Further reading: https://cwe.mitre.org/data/definitions/285.html
XSS Prevention Rules
Secure coding guidelines

More Related Content

PPTX
Secure coding practices
ODP
OWASP Secure Coding
PDF
OWASP Secure Coding Practices - Quick Reference Guide
PPTX
Secure Coding 101 - OWASP University of Ottawa Workshop
PPTX
Secure coding practices
PDF
Secure Code Review 101
PDF
Secure coding presentation Oct 3 2020
PPTX
Web application security
Secure coding practices
OWASP Secure Coding
OWASP Secure Coding Practices - Quick Reference Guide
Secure Coding 101 - OWASP University of Ottawa Workshop
Secure coding practices
Secure Code Review 101
Secure coding presentation Oct 3 2020
Web application security

What's hot (20)

PDF
Application Security - Your Success Depends on it
PPTX
OWASP Top 10 2021 What's New
PPT
Secure code practices
PPT
Application Threat Modeling
PPTX
Security testing
PPTX
Single sign on - SSO
PDF
Application Security | Application Security Tutorial | Cyber Security Certifi...
PPTX
Web Application Security 101
PPTX
Understanding Cross-site Request Forgery
PDF
Secure coding-guidelines
PPTX
Owasp top 10 vulnerabilities
PPTX
security misconfigurations
PPT
Basic Security Chapter 1
PDF
OWASP Top 10 Web Application Vulnerabilities
PPS
Security testing
PPTX
Security Code Review 101
PPTX
Vulnerability Assessment
PDF
Secure Coding principles by example: Build Security In from the start - Carlo...
PPTX
Blaze Information Security: The cost of fixing security vulnerabilities in ea...
Application Security - Your Success Depends on it
OWASP Top 10 2021 What's New
Secure code practices
Application Threat Modeling
Security testing
Single sign on - SSO
Application Security | Application Security Tutorial | Cyber Security Certifi...
Web Application Security 101
Understanding Cross-site Request Forgery
Secure coding-guidelines
Owasp top 10 vulnerabilities
security misconfigurations
Basic Security Chapter 1
OWASP Top 10 Web Application Vulnerabilities
Security testing
Security Code Review 101
Vulnerability Assessment
Secure Coding principles by example: Build Security In from the start - Carlo...
Blaze Information Security: The cost of fixing security vulnerabilities in ea...
Ad

Similar to Secure coding guidelines (20)

PPTX
Owasp Proactive Controls for Web developer
PDF
Serverless Security Checklist
PDF
APIsecure 2023 - Detect OWASP vulnerabilities in your APIs with Postman, Rahu...
PDF
OWASP ASVS 3 - What's new for level 1?
PDF
Web security uploadv1
PPTX
How to Test for The OWASP Top Ten
PPTX
Owasp top 10 2017
PPTX
Securing Applications in the Cloud
PPTX
SQLi for Security Champions
PPT
Security Design Principles.ppt
PPTX
Cm4 secure code_training_1day_error handling and logging
PPTX
Develop, Test & Maintain Secure Systems (While Being PCI Compliant)
PDF
OWASP Top 10 2017
PDF
PPTX
Security Design Principles for developing secure application .pptx
ODP
Java zone ASVS 2015
PPTX
Owasp Top 10 2017
PPTX
Security testing
PPTX
Owasp v8 analysis
PPTX
Hipaa security compliance checklist for developers & business associates
Owasp Proactive Controls for Web developer
Serverless Security Checklist
APIsecure 2023 - Detect OWASP vulnerabilities in your APIs with Postman, Rahu...
OWASP ASVS 3 - What's new for level 1?
Web security uploadv1
How to Test for The OWASP Top Ten
Owasp top 10 2017
Securing Applications in the Cloud
SQLi for Security Champions
Security Design Principles.ppt
Cm4 secure code_training_1day_error handling and logging
Develop, Test & Maintain Secure Systems (While Being PCI Compliant)
OWASP Top 10 2017
Security Design Principles for developing secure application .pptx
Java zone ASVS 2015
Owasp Top 10 2017
Security testing
Owasp v8 analysis
Hipaa security compliance checklist for developers & business associates
Ad

Recently uploaded (20)

PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Nekopoi APK 2025 free lastest update
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
System and Network Administraation Chapter 3
PDF
top salesforce developer skills in 2025.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
medical staffing services at VALiNTRY
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Introduction to Artificial Intelligence
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Odoo POS Development Services by CandidRoot Solutions
Nekopoi APK 2025 free lastest update
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Odoo Companies in India – Driving Business Transformation.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
System and Network Administraation Chapter 3
top salesforce developer skills in 2025.pdf
CHAPTER 2 - PM Management and IT Context
Understanding Forklifts - TECH EHS Solution
Reimagine Home Health with the Power of Agentic AI​
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Wondershare Filmora 15 Crack With Activation Key [2025
medical staffing services at VALiNTRY
Design an Analysis of Algorithms I-SECS-1021-03
Upgrade and Innovation Strategies for SAP ERP Customers
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Introduction to Artificial Intelligence
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises

Secure coding guidelines

  • 4. Injection Prevention Rules • Rule #1 (Perform proper input validation): Perform proper input validation. Positive or “whitelist” input validation with appropriate canonicalization is also recommended, but is not a complete defense as many applications require special characters in their input. • Rule #2 (Use a safe API): The preferred option is to use a safe API which avoids the use of the interpreter entirely or provides a parameterized interface. Be careful of APIs, such as stored procedures, that are parameterized, but can still introduce injection under the hood. • Rule #3 (Contextually escape user data): If a parameterized API is not available, you should carefully escape special characters using the specific escape syntax for that interpreter. • Further reading: https://www.owasp.org/index.php/Injection_Prevention_Cheat_Sheet
  • 5. Authentication Rules • Implement Proper Password Strength Controls • Implement Secure Password Recovery Mechanism • Store Passwords in a Secure Fashion • Transmit Passwords Only Over TLS or Other Strong Transport • Require Re-authentication for Sensitive Features • An application should respond with a generic error message regardless of whether the user ID or password was incorrect. • Prevent Brute-Force Attacks by disabling user account after multiple failed logins. • Enable logging and monitoring of authentication functions to detect attacks • Further reading: https://www.owasp.org/index.php/Authentication_Cheat_Sheet
  • 6. Sensitive Data Rules • Classify data processed, stored or transmitted by application. • Identify which data is sensitive according to laws, regulation and business needs. • Dont store sensitive data unnecessarily. Data that is not retained cannot be stolen. • Make sure to encrypt sensitive data at rest. • Encrypt all data in transit with secure protocols like TLS • Disable caching for responses which contain sensitive data. • Further reading: http://cwe.mitre.org/data/definitions/312.html
  • 7. Access Control Rules • Divide the software into anonymous, normal, privileged, and administrative areas. Carefully map roles with data and functionality. • Ensure that you perform access control checks related to your business logic. • Consider using authorization frameworks such as the JAAS Authorization Framework. • For web applications, make sure that the access control mechanism is enforced correctly at the server side on every page. • Use the access control capabilities of your operating system and server environment. • Further reading: https://cwe.mitre.org/data/definitions/285.html