Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security issue #177

Merged
merged 5 commits into from
Aug 24, 2020
Merged

Security issue #177

merged 5 commits into from
Aug 24, 2020

Conversation

Rupeshiya
Copy link
Member


name: Pull Request template
about: Describe the PR.
title: ''
labels: ''
assignees: ''


Problem

Github Issue Number: #176
Fix security flaws

Solution of problem

Fixed:

  • DOS attack
  • XSS attack
  • Rate limiter
  • CSRF token attack
  • Clickjacking attack
  • protect against HTTP Parameter Pollution attacks using HPP
  • Hide password from client-side
  • Hide user tokens

Type of Change

[ ] Bug fix
[ ] New Feature
[ ] Development of UI/UX prototypes
[✓] Small refactor
[ ] Change in Documentation

Checklist

[✓] My code follows the same style as the codebase
[ ] My Code change requires a change in documentation
[ ] I have updated the Readme accordingly
[✓] I made PR against development branch
[✓] I have run the test cases locally and it's passing.
[ ] I have squashed my commits

@Rupeshiya Rupeshiya force-pushed the security_issue branch 2 times, most recently from aa9a4b7 to 51faa6e Compare August 23, 2020 10:31
app.js Show resolved Hide resolved
@vaibhavdaren
Copy link
Member

Did you run test cases after making security changes. Looks good to go overall :)

const WINDOW_LOG_INTERVAL_IN_HOURS = 1

module.exports = {
customRateLimiter: (req, res, next) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a testcase for this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sure

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rate limiter is working tried to send more than 100 requests then it's sending this responses:
image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increased no of requests in testing env to 500 and in development or prod 200 no of requests

@Rupeshiya
Copy link
Member Author

Rate limiter:
rateLimiter

Other test cases
test

@Rupeshiya
Copy link
Member Author

Rupeshiya commented Aug 24, 2020

Passing all the test cases except #137 issue

@vaibhavdaren vaibhavdaren merged commit 1e5a045 into codeuino:development Aug 24, 2020
Rupeshiya added a commit to Rupeshiya/social-platform-donut-backend that referenced this pull request Aug 25, 2020
* update code

* initial mechanism for user tracking

initial mechanism for user tracking

Security issue (codeuino#177)

* update code

* fix security flaws

* fixed test cases

minor fixes
Rupeshiya added a commit to Rupeshiya/social-platform-donut-backend that referenced this pull request Aug 26, 2020
* update code

* fixed failing test cases and missing test cases

User activity tracker using redis (codeuino#174)

* update code

* initial mechanism for user tracking

initial mechanism for user tracking

Security issue (codeuino#177)

* update code

* fix security flaws

* fixed test cases

hot fix

add docs for contributors
vaibhavdaren added a commit that referenced this pull request Sep 13, 2020
* added update restrictions, techStacks in project and orgId to a user

* added edit restriction mechanism

* intial deactivation mechanism

* intial logging mechanism and deactive account

* issue fix

* fixing org creation issue

* Fixes issues in testing (#160)

* fix failing test file user.test.js

* fixes EADDRINUSE while testing

* fixes issues in prposal route

* fixed issues in org route and added new tests

* Moving Google Analytics requests to backend (#154)

* Moving Google Analytics requetss to backend

* Requested Changes

* Minor changes

* Adding code to prevent attacks (#153)

* modified user's api (#168)

* modified user's api

* login options during login

* Changes for reactions (#166)

* Revert "Adding code to prevent attacks (#153)" (#170)

This reverts commit 57a0cf9.

* Fixed and written all the missing test cases (#172)

* update code

* fixed failing test cases and missing test cases

* User activity tracker using redis (#174)

* update code

* initial mechanism for user tracking

initial mechanism for user tracking

* Security issue (#177)

* update code

* fix security flaws

* fixed test cases

* minor fixes (#178)

* add docs for new contributors (#181)

Co-authored-by: Devesh Verma <[email protected]>
Co-authored-by: Kumar Saurabh Raj <[email protected]>
Co-authored-by: Asel Peiris <[email protected]>
Co-authored-by: pranjals149 <[email protected]>
Co-authored-by: Vaibhav D. Aren <[email protected]>
vaibhavdaren added a commit that referenced this pull request Sep 13, 2020
* added update restrictions, techStacks in project and orgId to a user

* added edit restriction mechanism

* intial deactivation mechanism

* intial logging mechanism and deactive account

* issue fix

* fixing org creation issue

* Fixes issues in testing (#160)

* fix failing test file user.test.js

* fixes EADDRINUSE while testing

* fixes issues in prposal route

* fixed issues in org route and added new tests

* Moving Google Analytics requests to backend (#154)

* Moving Google Analytics requetss to backend

* Requested Changes

* Minor changes

* Adding code to prevent attacks (#153)

* modified user's api (#168)

* modified user's api

* login options during login

* Changes for reactions (#166)

* Revert "Adding code to prevent attacks (#153)" (#170)

This reverts commit 57a0cf9.

* Fixed and written all the missing test cases (#172)

* update code

* fixed failing test cases and missing test cases

* User activity tracker using redis (#174)

* update code

* initial mechanism for user tracking

initial mechanism for user tracking

* Security issue (#177)

* update code

* fix security flaws

* fixed test cases

* minor fixes (#178)

* add docs for new contributors (#181)

* frontend sync master gsoc  (#169) (#191)

* added update restrictions, techStacks in project and orgId to a user

* added edit restriction mechanism

* intial deactivation mechanism

* intial logging mechanism and deactive account

* issue fix

* fixing org creation issue

* Fixes issues in testing (#160)

* fix failing test file user.test.js

* fixes EADDRINUSE while testing

* fixes issues in prposal route

* fixed issues in org route and added new tests

* Moving Google Analytics requests to backend (#154)

* Moving Google Analytics requetss to backend

* Requested Changes

* Minor changes

* Adding code to prevent attacks (#153)

* modified user's api (#168)

* modified user's api

* login options during login

* Changes for reactions (#166)

Co-authored-by: Rupeshiya <[email protected]>
Co-authored-by: Devesh Verma <[email protected]>
Co-authored-by: Kumar Saurabh Raj <[email protected]>
Co-authored-by: Asel Peiris <[email protected]>
Co-authored-by: pranjals149 <[email protected]>

Co-authored-by: Devesh Verma <[email protected]>
Co-authored-by: Vaibhav D. Aren <[email protected]>
Co-authored-by: Kumar Saurabh Raj <[email protected]>
Co-authored-by: Asel Peiris <[email protected]>
Co-authored-by: pranjals149 <[email protected]>

Co-authored-by: Rupeshiya <[email protected]>
Co-authored-by: Devesh Verma <[email protected]>
Co-authored-by: Kumar Saurabh Raj <[email protected]>
Co-authored-by: Asel Peiris <[email protected]>
Co-authored-by: pranjals149 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants