sign in (eg. olx.in, https://sso.zetaapps.in/first-factor/otp/request). How to bruteforce? Use any intercepting proxy, python or ruby scripts to execute the login requests with different combinations in multiple threads. Countermeasure: 1. Rate limiting on the API endpoints. 2. Captcha after few invalid requests. 3. OTP invalidation after 3 failed attempts.
to inject client side scripts in web applications. Reflected XSS Reflected attacks are those where the injected code is reflected off the web server, such as in an error message, search result, or any other response that includes some or all of the input sent to the server as part of the request. Reflected attacks are delivered to victims via another route, such as in an e-mail message, or on some other web server. Cross site scripting - XSS
is permanently stored on the target servers, such as in a database, in a message forum, visitor log, comment field, etc. The victim then retrieves the malicious script from the server when it requests the stored information. Impact: DOM manipulation(website defamation), User account takeover. Cross site scripting - XSS
Encode input while storing in database - <%= sanitize @recipe.description, :tags => %w[b i a], :attributes => %w[href] %> “Never trust inputs from the client”
to view/change/delete User B’s data - Possible IDOR on critical endpoints like Order cancellation, Order tracking, Seller invoice details. (seller.voonik.com/oms/labels/50030691/print) - Eg. uae.souq.com (Order tracking endpoint), Craftsvilla (Order cancellation) Insecure Direct Object references.
Countermeasure Check for the authorization for the restricted resource @project = @current_user.projects.find(params[:id]) As an additional step of security, even when authorization is bypassed, Randomisation can make it harder for the attacker to exploit. seller.voonik.com/oms/labels/2d9d260f-25f4-47f2-b305-faf37e35ef2d/print http://www.limeroad.com/user/579af748f80c246218701482FT - https://www.ft.com/content/0cae0c78-dda5-11e6-9d7c-be108f1c1dce https://help.uber.com/h/53539bde-f6f4-4909-85de-fa0b99f82be0#_
characters, which will escape ' , " , NULL character and line breaks. Instead of using inputs directly in the conditions Instead of passing a string to the conditions option, you can pass an array to sanitize tainted strings like this: Project.where("name = ?",params[:name]) Vulnerable code: Project.where(“name = ‘#{params[:name]}’” Assume the user supplies name input as name = "Mithun ' or '1'='1" Query becomes Project.where("name = 'Mithun' or '1'='1' ") SQL injection mitigation.
Design (Authentication, Authorization, Auditing.) Consider obfuscation of user_id. Building Eg., Sanitising/Validating all the user supplied inputs. Testing Automated scanning of each build before release. Deployment Security sign-off.