Adding a NoSQL Injection vulnerability#81
Conversation
…using nosql injection adding a route that exposes a query parameter that the user can easily control and exlpoit the underlying mongodb $where clause to inject javascript code
|
Great! Thanks @lirantal . I will review and merge the PR soon. |
|
Thanks @ckarande |
|
Hey @ckarande, I updated the PR with documentation for the tutorial. |
|
@lirantal , Thank you very much for the PR and updated documentation. The changes to the code look good. I had a few suggetions / questions - To make the vulnerability easier and bit more obivious for users to exploit, is it possible to enhance it a bit - instead of setting the threshold to 2, can we create a text field for that? May be we can move this new textfield to the top (above Domestic Stocks label). It would be even better if we could allow users to select the type of asset to filter on instead of limiting it to stocks by providing a dropdown for asset types. Depending on the threshold we can hide / show the assets. Please let me know your thoughts. |
|
@ckarande sure, good comments. I'll think about how to better layout the UI there. |
|
@ckarande what do you think about this one? Adding a drop down per stock might be confusing and I don't see much value in there. WDYT? |
|
Excellent 👍 |
|
@ckarande I updated the PR. |
…odeGoat into feat/add-a1-2-nosql-injection
|
Thanks @lirantal .. What inputs you use for filter to craft the injection attack? |
|
@ckarande use this query to trigger a DoS attack on the MongoDB: |
|
Thanks! |
|
I'm just wondering if it would make sense or be more in keeping with the existing style of the app to merge: In app/routes/index.js
and in the comments in app/data/allocations-dao.js provide a specific fix like I think most/all of the other OWASP Top 10 defects commented in code supply? PR #85 Addresses this. |
|
Sure I don't mind. |
|
@binarymist 👍 . These changes make sense and keeps the style consistent. |
|
Thanks! |


This PR adds a malicious NoSQL Injection vulnerability tagged as A-2 to the allocations view.
It adds an insecure use of input parameters from a GET request that is used to filter the allocations view results only for specific items.
If it looks good I will accompany it with documentation updates to the docs/tutorial.