Skip to content

Commit c539a3d

Browse files
Merge pull request #69 from snoopysecurity/new-vulns
feat: add rate limit bypass test
2 parents 99dc78f + 99db3b2 commit c539a3d

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ This vulnerable application contains the following API/Web Service vulnerabiliti
3838
* XML Bomb Denial-of-Service
3939
* SOAP Injection
4040
* Cross-Site Request Forgery (CSRF)
41+
* Rate Limit Bypass
4142
* Client Side Template Injection
4243

4344
## Set Up Instructions

test/vulnerabilities.test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ describe("DVWS-Node Vulnerability Tests", function () {
330330
const authFailed = responses.every(res => res.status === 401);
331331
expect(authFailed).to.eql(true);
332332
});
333+
333334
});
334335

335336
describe("26. CRLF Injection (Log Pollution)", function () {
@@ -453,4 +454,35 @@ describe("DVWS-Node Vulnerability Tests", function () {
453454
expect(adminUser).to.have.property('password', 'letmein');
454455
});
455456
});
457+
458+
describe("36. Rate Limit Bypass", function () {
459+
it("should allow bypassing IP-based rate limit using X-Forwarded-For header", async function () {
460+
// 1. Flood from a specific IP to trigger ban
461+
const blockedIP = "192.168.1.200";
462+
const attempts = 110; // Max is 100
463+
const promises = [];
464+
465+
for (let i = 0; i < attempts; i++) {
466+
promises.push(
467+
request
468+
.post("/login")
469+
.set("X-Forwarded-For", blockedIP)
470+
.send({ username: "admin", password: "wrong" + i })
471+
);
472+
}
473+
474+
const responses = await Promise.all(promises);
475+
const rateLimited = responses.some(res => res.status === 429);
476+
expect(rateLimited).to.eql(true, "Rate limit should have been triggered");
477+
478+
// 2. Bypass using a different IP via X-Forwarded-For
479+
const bypassIP = "192.168.1.201";
480+
const response = await request
481+
.post("/login")
482+
.set("X-Forwarded-For", bypassIP)
483+
.send({ username: "admin", password: "password" });
484+
485+
expect(response.status).to.not.equal(429, "Rate limit should be bypassed with new IP");
486+
});
487+
});
456488
});

0 commit comments

Comments
 (0)