OWASP Cheat Sheet Series

= Main =  

{| style="padding: 0;margin:0;margin-top:10px;text-align:left;" |-
 * valign="top" style="border-right: 1px dotted gray;padding-right:25px;" |

Our goal
The OWASP Cheat Sheet Series was created to provide a concise collection of high value information on specific application security topics. These cheat sheets were created by various application security professionals who have expertise in specific topics. We hope that the OWASP Cheat Sheet Series provides you with excellent security guidance in an easy to read format.

If you have any questions about the OWASP Cheat Sheet Series, please email the project leader [mailto:jim.manico@owasp.org Jim Manico], subscribe to our project email list or contact us on the project's Slack channel.

Bridge between the projects OWASP Proactive Controls and OWASP Cheat Sheet Series
A work channel has been created between these 2 projects using the following process (OPC = OWASP Proactive Controls / OCS = OWASP Cheat Sheet):


 * When a Cheat Sheet is missing for a Control in OPC then the OCS will handle the missing and create one. When the Cheat Sheet is ready then the reference is added by OPC.
 * If a Cheat Sheet exists for an OPC Control but the content do not provide the expected help about the Control then the Cheat Sheet is updated to provide the content needed/expected by the Control.

The reason of the creation of this bridge is to add more consistency to the OCS project by providing it:


 * A consistent source for the requests regarding new Cheat Sheets.
 * Same approach about the update of the existing Cheat Sheets.
 * A usage context for the Cheat Sheet and a quick source of feedack about the quality and the efficiency of the Cheat Sheet.

It is not mandatory that a request for a new Cheat Sheet (or for an update) come only from OPC but it will become, with the time, the main input source.

Requests from OPC are flagged with the label "OWASP Proactive Controls Request" in the roadmap in order to identify them and set them as a top level priority.

Authors
Project Leaders:
 * Jim Manico [mailto:jim.manico@owasp.org @]
 * Dominique Righetto [mailto:dominique.righetto@owasp.org @]

Contributors: Paweł Krawczyk, Mishra Dhiraj, Shruti Kulkarni, Torsten Gigler, Michael Coates, Jeff Williams, Dave Wichers, Kevin Wall, Jeffrey Walton, Eric Sheridan, Kevin Kenan, David Rook, Fred Donovan, Abraham Kang, Dave Ferguson, Shreeraj Shah, Raul Siles, Colin Watson, Neil Matatall, Zaur Molotnikov, Manideep Konakandla, Santhosh Tuppad and many more!

OWASP Cheat Sheets

 * valign="top" style="padding-left:25px;width:200px;" |

Slack & Twitter
Slack channel information:
 * Server
 * Channel

Twitter hash tag: #owaspcheatsheetseries

Book
A PDF book of all Cheat Sheets can be downloaded here.

Email List
Project Email List

Still used for technical discussion but we highly prefer:
 * The Slack channel for announcement and technical discussion.
 * The Twitter hash tag for announcement only.

Licensing
The OWASP Cheat Sheet Series is free to use under the Creative Commons ShareAlike 3 License.

Related Projects

 * OWASP Proactive Controls
 * OWASP Application Security Verification Standard Project

News and Events

 * [Dec 01 2018] Injection Prevention Cheat Sheet in Java updated
 * [Nov 24 2018] Securing Cascade Style Sheets Cheat Sheet added to project
 * [Nov 08 2018] Creation and sharing of the project logos
 * [Oct 13 2018] CSRF Prevention Cheat Sheet refactored
 * [Sep 25 2018] Abuse Case Cheat Sheet added to project
 * [Aug 25 2018] Cleanup of Cheat Sheets finished
 * [Jul 15 2018] Error Handling Cheat Sheet added to project
 * [Jun 12 2018] Made available the PDF book of all Cheat Sheets
 * [May 10 2018] Protect File Upload Against Malicious File Cheat Sheet updated
 * [Mar 18 2018] Password Storage Cheat Sheet updated
 * [Feb 21 2018] HTML5 Security Cheat Sheet updated
 * [Feb 18 2018] Password Storage Cheat Sheet updated
 * [Jan 14 2018] Insecure Direct Object Reference Prevention Cheat Sheet updated
 * [Dec 04 2017] Ruby On Rails Cheat Sheet updated
 * [Nov 19 2017] JWT Cheat Sheet for Java updated
 * [Nov 17 2017] OS Command Injection Defense Cheat Sheet added to project
 * [Nov 04 2017] Authorization Testing Automation Cheat Sheet added to project
 * [Jan 17 2017] XML Security Cheat Sheet added to project
 * [Feb 06 2016] New navigation template rolled out project-wide
 * [Jun 11 2015] SAML Cheat Sheet added to project
 * [Feb 11 2015] Cheat Sheet "book" added to project
 * [Apr 04 2014] All non-draft cheat sheets moved to new wiki template!
 * [Feb 04 2014] Project-wide cleanup started


 * }

= Master Cheat Sheet =

Authentication
Ensure all entities go through an appropriate and adequate form of authentication. All the application non-public resource must be protected and shouldn't be bypassed.

For more information, check Authentication Cheat Sheet

Session Management
Use secure session management practices that ensure that authenticated users have a robust and cryptographically secure association with their session.

For more information, check Session Management Cheat Sheet

Access Control
Ensure that a user has access only to the resources they are entitled to. Perform access control checks on the server side on every request. All user-controlled parameters should be validated for entitlemens checks. Check if user name or role name is passed through the URL or through hidden variables. Prepare an ACL containing the Role-to-Function mapping and validate if the users are granted access as per the ACL.

For more information, check Access Control Cheat Sheet

Input Validation
Input validation is performed to minimize malformed data from entering the system. Input Validation is NOT the primary method of preventing XSS, SQL Injection. These are covered in output encoding below.

For more information, check Input Validation Cheat Sheet

Output Encoding
Output encoding is the primary method of preventing XSS and injection attacks. Input validation helps minimize the introduction of malformed data, but it is a secondary control.

For more information, check XSS (Cross Site Scripting) Prevention Cheat Sheet.

Cross Domain
Ensure that adequate controls are present to prevent against Cross-site Request Forgery, Clickjacking and other 3rd Party Malicious scripts.

For more information, check Cross Site Request Forgery

Secure Transmission
Ensure that all the applications pages are served over cryptographically secure HTTPs protocols. Prohibit the transmission of session cookies over HTTP.

For more information, check Transport Protection Cheat Sheet

Logging
Ensure that all the security related events are logged. Events include: User log-in (success/fail); view; update; create, delete, file upload/download, attempt to access through URL, URL tampering. Audit logs should be immutable and write only and must be protected from unauthorized access.

For more information, check Logging Cheat Sheet

Uploads
Ensure that the size, type, contents, and name of the uploaded files are validated. Uploaded files must not be accessible to users by direct browsing. Preferably store all the uploaded files in a different file server/drive on the server. All files must be virus scanned using a regularly updated scanner.

For more information, check https://www.owasp.org/index.php/Input_Validation_Cheat_Sheet#File_Uploads

= Roadmap =

Global:


 * Bring all cheat sheets out of draft fin end of 2018.
 * Go through the cheat sheets to make sure what they recommend is consistent with ASVS.
 * Move all code snippets of CS from pre tag to syntaxhighlight tag to enhance CS readability.
 * Go through the cheat sheets to make sure they follow the CS guideline.
 * Remove CS that that do not bring added value.

Next work on Cheat Sheets (CS) and work assignment:

Roadmap is now managed via this Trello Board.

If you want to contribute on a CS, please create a Trello account and notify the project leaders (by Email or by Slack) in order that we affect you on a CS task (represented as a Trello Card).

= Cheat sheet Guideline =

Cheat sheet creation workflow


Note:
 * The schema has been created using https://www.draw.io site.
 * XML source file of the schema is [[Media:NewCheatSheetCreationWorkflow.zip|here]], use this file to edit the schema with Draw.io site.

Cheat sheet content
The key points that all cheat sheets (called CS) must provides are the following:


 * 1) Address a single topic (ex: password storage, OS command injection, REST service, CSRF, HTML5 new features security...).
 * 2) Be concise and focused: A cheat sheet must be directly actionable (a CS is not a guide) and must be directly useful for a developer.
 * 3) Do not re-address topic handled by others CS. In this case, the target CS will be enhanced with missing points.
 * 4) When applicable, provide a solution proposal implementation through a full documented POC on a public well know Git repository (GitHub is highly prefered), the POC can be used as a playground for a developer wanting to play/evaluate your solution proposal.

Cheat sheet structure
A CS must have these sections:


 * 1) Introduction: Provide high level information about the topic in order to introduce it to people that do not know it. You can add pointer to external sources if needed but at least give an overview allowing a reader to continue on the CS. You can also add schema or diagram in any part of the CS but be sure to respect the copyright of the source file.
 * 2) Context: Describe the security issues that are bring or commonly meet when someone must work on this topic.
 * 3) Objective: Describe the objective of the CS. What the CS will bring to the reader?
 * 4) Proposition:
 * 5) Describe how to address the security issues in a possible technology agnostic approach.
 * 6) Using your POC, describe your solution proposal in the more teaching possible way.
 * 7) Sources of the prototype: Add pointer to the public GitHub repository on which the source code of POC is hosted.

For the code snippet, use the mediawiki tag syntaxhighlight:
 * Tag documentation.
 * Supported languages.

If you want to be careful in order to prevent to break something in the target existing CS, you can follow this contribution procedure:
 * 1) Take a copy of the CS that you want to enhance (mediawiki syntax in the source tab).
 * 2) Add your enhancement and publish the updated CS on the same GitHub repository than your POC (it support the mediawiki syntax).
 * 3) Notify the CS Community using this mailing list and the CS Community will review the CS using GitHub comments system.
 * 4) When the feedback loop is finished, the CS Community will help you to have right access to the wiki in order to update the CS.

Cheat sheet template
If the target CS is a new one then please use the following template struture.

It allow you to work:
 * Online by using the wiki Show preview option.
 * Offline by using an text editor like:
 * Atom with the mediawiki plugin.
 * Gedit with the syntax highlighting extension.

= Project Logo =

Project is now finished, we let the specification online for further evolution of the logo.

Big thanks to Amélie Didion for the design work.

Logo files
Logo files are hosted on the official OWASP dedicated Github repository.

Logo n°1:



Logo n°2:



Objective
This section contains the information that we have gathered and plan to use for the creation of the project logo and related design materials.

The first phase of the work is to commission a project logo.

Introduction
The project requires a logo which will comprise three components:


 * Graphical element indicating the idea or use of the cheat sheets
 * The project title
 * Motto/straplines.

Not all of these will necessarily be shown together at the same time. Phase 1 requires the creation of a logo, which may be used with one, two or all three of these components.

The logo will be used in many ways such as on a website banner, or just the graphical element on a bag, or the graphical element and a motto/strapline on a t-shirt. These other outputs are not included in the scope of Phase 1.

Project Name
The project name is OWASP Cheat Sheet Series project. The project name will be positioned next to the graphical element in some outputs, and this layout must be provided. In other cases, the project name will not be included beside the logo.

Motto/Strapline
Three mottos/straplines will be used in the logo - they are context dependent:


 * Life is too short, AppSec is tough, Cheat!
 * Its not cheating if you do it for the right reasons
 * Sometimes the only good thing to do is cheat.

The logo layout must allow for any of these or none to be included.

Layout, Media Formats and Colours
Some media or placements may mean the motto/strapline does not fit or is not needed. Therefore the logo must be usable with, or without, the motto/strapline.

The logo will need to be used at multiple scales. For example, if the logo is square excluding the motto/strapline, the following formats must work


 * Low-resolution use on web pages (e.g. as small as 100x100 pixels excluding moto/strapline)
 * Medium resolution use on fabric such as t-sirts or bags (e.g. 900x900 pixels at 150 dpi)
 * High-resolution use on large posters and banners (e.g. as large as 5,000x5,000 pixels at 300dpi).

The logo may be printed in CMYK for physical media, but must also have RGB colours for screen use. Additionally the logo must also be available in grayscale, and separately as single colour (i.e. black and white without any tones).

Deliverables Required
All outputs must be provided digitally:


 * 1) Logo demonstrating how it looks with just the graphical element, the graphical element with the project title, and the graphical element with each of the mottos/straplines, and everything together
 * 2) Source layered vector graphic files created in Adobe Illustrator
 * 3) Exported versions for quick use low, medium and high resolution full-colour PNG/JPEGs in RGB and CMYK
 * 4) Colour and font specification.

Rights/licensing:


 * 1) The designer will not retain any rights - all design and use rights will be given to OWASP, who will publish the logo and files using am open source licence, and OWASP will be able to use the logo, source files, ideas, designs in any manner it desires in any media in any quantity, without any additional payments, commission or royalties to the designer or anyone else
 * 2) All fonts used in the design must be provided to OWASP and comply with the above requirements

Future Phases: Other Graphical Elements
Scope TBC - Banners, t-shirts, etc

Background pictures (picture provider and designer will be cited on the project site):
 * A smart tech looking woman reading a piece of paper (the cheatsheet) while resting on a beach.
 * A woman hand holding cards with an ace up the sleeve.

Pictures proposal (just a proposal as bootstrap, others pictures can be used):
 * Cards:
 * https://www.pexels.com/photo/woman-holding-queen-of-hearts-and-diamonds-922706/
 * https://www.pexels.com/photo/ace-card-gambling-hand-274373/
 * https://www.pexels.com/photo/ace-bet-business-card-262333/
 * Beach:
 * https://www.pexels.com/photo/laptop-mockup-notebook-outside-4778/
 * https://www.pexels.com/photo/apple-check-computer-female-7079/
 * https://www.pexels.com/photo/beach-beach-chair-blur-casual-319921/
 * https://www.pexels.com/photo/close-up-of-woman-typing-on-keyboard-of-laptop-6352/
 * https://www.pexels.com/photo/black-and-gray-computer-laptop-159784/