Skip to content

Commit c90ecf0

Browse files
Update README.md
1 parent 11699de commit c90ecf0

File tree

1 file changed

+0
-75
lines changed

1 file changed

+0
-75
lines changed

README.md

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -74,84 +74,9 @@ Our detailed explainations should help the first type while we hope our checklis
7474
17. Security Vs Usability
7575
18. Back to Square 1: The Security Checklist explained
7676

77-
### The Security Checklist
7877

79-
##### AUTHENTICATION SYSTEMS (Signup/Signin/2 Factor/Password reset)
80-
- [ ] Use HTTPS everywhere.
81-
- [ ] Store password hashes using `Bcrypt` with a random `salt`.
82-
- [ ] Destroy the session identifier after `logout`.
83-
- [ ] Destory all active sessions on reset password (or offer to).
84-
- [ ] Must have the `state` parameter in OAuth2
85-
- [ ] No open redirects after successful login or in any other intermediate redirects.
86-
- [ ] While Signup/Login input, sanitize input for javascript://, data://, CRLF characters.
87-
- [ ] Set secure, httpOnly cookies.
88-
- [ ] In Mobile `OTP` based mobile verification, do not send the OTP back in the response when `generate OTP` or `Resend OTP` API is called.
89-
- [ ] Limit attempts to `Login`, `Verify OTP`, `Resend OTP` and `generate OTP` APIs for a particular user. Have an exponential backoff set or/and something like a captcha based challenge.
90-
- [ ] Check for randomness of reset password token in the emailed link or SMS
91-
- [ ] Set an expiration on the reset password token for a reasonable period.
92-
- [ ] Expire the reset token after it has been successfully used.
93-
- [ ] Destroy the logged in user's session everywhere after successful reset of password.
9478

9579

96-
##### USER DATA & AUTHORIZATION
97-
- [ ] Any resource access like, `my cart`, `my history` should check the logged in user's ownership of the resource using session id.
98-
- [ ] Serially iterable resource id should be avoided. Use `/me/orders` instead of `/user/37153/orders`. This acts as a sanity check in case you forgot to check for authorization token.
99-
- [ ] `Edit email/phone number` feature should be accompanied by a verification email to the owner of the account.
100-
- [ ] Any upload feature should sanitize the filename provided by the user. Also, for generally reasons apart from security, upload to something like S3 (and post-process using lambda) and not your own server capable of executing code.
101-
- [ ] `Profile photo upload` feature should sanitize all the `EXIF` tags also if not required.
102-
- [ ] For user ids and other ids, use [RFC complaint ](http://www.ietf.org/rfc/rfc4122.txt) `UUID` instead of integers. You can find an implementation for this for your language on Github.
103-
- [ ] JWT are awesome, use them if required for your single page app/APIs.
104-
105-
106-
##### ANDRIOD / IOS APP
107-
- [ ] `salt` from payment gateways should not be hardcoded.
108-
- [ ] `secret` / `auth token` from 3rd party SDK's should not be hardcoded.
109-
- [ ] API calls intended to be done `server to server` should not be done from the App.
110-
- [ ] In Android, all the granted [permissions](https://developer.android.com/guide/topics/security/permissions.html) should be carefully evaluated.
111-
- [ ] [Certificate pinning](https://en.wikipedia.org/wiki/HTTP_Public_Key_Pinning) is highly recommended.
112-
113-
114-
##### SECURITY HEADERS & CONFIGURATIONS
115-
- [ ] `Add` [CSP](https://en.wikipedia.org/wiki/Content_Security_Policy) header to mitigate XSS and data injection attacks. This is important.
116-
- [ ] `Add` [CSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery) header to prevent cross site request forgery.
117-
- [ ] `Add` [HSTS](https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security) header to prevent SSL stripping attack.
118-
- [ ] `Add` [X-Frame-Options](https://en.wikipedia.org/wiki/Clickjacking#X-Frame-Options) to protect against Clickjacking.
119-
- [ ] `Add` [X-XSS-Protection](https://www.owasp.org/index.php/OWASP_Secure_Headers_Project#X-XSS-Protection) header to mitigate XSS attacks.
120-
- [ ] Update DNS records to add [SPF](https://en.wikipedia.org/wiki/Sender_Policy_Framework) record to mitigate spam and phishing attacks.
121-
- [ ] Add [subresource integrity checks](https://en.wikipedia.org/wiki/Subresource_Integrity) if loading your JavaScript libraries from a third party CDN.
122-
- [ ] Use random CSRF tokens and expose buisness logic APIs as HTTP POST requests. Do not expose CSRF tokens over HTTP for example in a inital request upgrade phase.
123-
- [ ] Do not use critical data or tokens in GET request parameters. Exposure of server logs or a machine/stack processing them would expose user data in turn.
124-
125-
##### SANITIZATION OF INPUT
126-
- [ ] `Sanitize` all user inputs or any input parameters exposed to user to prevent [XSS](https://en.wikipedia.org/wiki/Cross-site_scripting)
127-
- [ ] `Sanitize` all user inputs or any input parameters exposed to user to prevent [SQL Injection](https://en.wikipedia.org/wiki/SQL_injection)
128-
- [ ] Sanitize user input if using it directly for functionalites like CSV import.
129-
- [ ] `Sanitize` user input for special cases like robots.txt as profile names in case you are using a url pattern like coolcorp.io/username.
130-
- [ ] Do not hand code or build JSON by string concatentation ever, no matter how small the object is. Use your langauge defined libraries or framework.
131-
- [ ] Sanitize inputs that take some sort of URLs to prevent [SSRF](https://docs.google.com/document/d/1v1TkWZtrhzRLy0bYXBcdLUedXGb9njTNIJXa3u9akHM/edit#heading=h.t4tsk5ixehdd).
132-
- [ ] Sanitize Outputs before displaying to users.
133-
134-
##### OPERATIONS
135-
- [ ] If you are small and inexperienced, evaluate using AWS elasticbeanstalk or a PaaS to run your code.
136-
- [ ] Use a decent provisioning script to create VMs in the cloud.
137-
- [ ] Check for machines with unwanted publicly `open ports`.
138-
- [ ] Check for no/default passwords for `databases` especially MongoDB & Redis. BTW MongoDB sucks, avoid it.
139-
- [ ] Use SSH to access your machines, do not setup a password.
140-
- [ ] Install updates timely to act upon zero day vulnerabilities like Heartbleed, Shellshock.
141-
- [ ] Modify server config to use TLS 1.2 for HTTPS and disable all other schemes. (The tradeoff is good)
142-
- [ ] Do not leave the DEBUG mode on. In some frameworks, DEBUG mode can give access full-fledged REPL or shells or expose critical data in error messages stacktraces.
143-
- [ ] Be prepared for bad actors & DDOS - use [Cloudflare](https://www.cloudflare.com/ddos/)
144-
- [ ] Setup monitoring for your systems and log stuff (use Newrelic or something like that)
145-
- [ ] If developing for enterprise customers, adhere to compliance requirements. If AWS S3, consider using the feature to [encrypt data](http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html). If using AWS EC2, consider using the feature to use encrypted volumes (even boot volumes can be encypted now).
146-
147-
##### PEOPLE
148-
- [ ] Setup an email (e.g. security@coolcorp.io) and a page for security researchers to report vulnerabilities.
149-
- [ ] Depending on what you are making, limit access to your user databases.
150-
- [ ] Be polite to bug reporters.
151-
- [ ] Have your code review done by a fellow developer from a secure coding perspective. (More eyes)
152-
- [ ] In case of a hack or data breach, check previous logs for data access, ask people to change passwords. You might require an audit by external agencies depending on where you are incorporated.
153-
- [ ] Setup Netflix Scumblr to hear about talks about your organization on social platforms and Google search.
154-
15580
### Who are we?
15681

15782
We are full stack developers who just grew tired by watching how developers were lowering the barrier to call something a hack by writing unsecure code. In the past six months we have prevented leaks of more than 15 million credit card details, personal details of over 45 million users and potentially saved companies from shutting down. Recently, we discovered an issue that could result in system takeover and data leak in a bitcoin institution. We have helped several startups secure their systems, most of them for free, sometimes without even getting a thank you in response :)

0 commit comments

Comments
 (0)