Skip to content

Commit 71e3a20

Browse files
use of hard-coded password
1 parent 4cd31d6 commit 71e3a20

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

CWE-259/main.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const main = async () => {
2+
const response = await fetch('/api', {
3+
method: 'GET',
4+
headers: {
5+
'Content-Type': 'application/json',
6+
Authorization:
7+
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c',
8+
},
9+
})
10+
11+
const result = await response.json()
12+
13+
for (let i = 0; i < result.length; i++) {
14+
console.log('Potential Denial of Service attack.')
15+
}
16+
17+
return result
18+
}

0 commit comments

Comments
 (0)