Skip to content

Commit 9eee733

Browse files
authored
Merge pull request #243 from caido-community/link-manipulation-check
2 parents 0f5c3d9 + a6b503d commit 9eee733

7 files changed

Lines changed: 764 additions & 0 deletions

File tree

.cursor/rules/tests.mdc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
alwaysApply: true
3+
---
4+
5+
## Testing Guidelines
6+
7+
Write tests that focus on actual behavior, not implementation details. Test both positive and negative cases with realistic mock data. Use descriptive test names that clearly describe the scenario and expected behavior.
8+
9+
## Critical: Don't Fix Tests to Pass Invalid Behavior
10+
11+
The most common mistake is adjusting tests to pass when the check itself has bugs.
12+
13+
When a test fails:
14+
1. First, determine if it's a test issue or check issue
15+
2. If the check behavior is wrong, fix the check, not the test
16+
3. Only adjust the test if the test expectations were incorrect
17+
18+
It's a CHECK issue when:
19+
- The check produces false positives (finds vulnerabilities that don't exist)
20+
- The check produces false negatives (misses real vulnerabilities)
21+
- The check runs when it shouldn't (wrong conditions)
22+
- The check doesn't run when it should
23+
- The findings have incorrect severity or descriptions
24+
25+
It's a TEST issue when:
26+
- Test expectations don't match the intended check behavior
27+
- Mock data doesn't properly represent the scenario
28+
- Test setup is incorrect or incomplete
29+
- Test assertions are checking the wrong things
30+
31+
Always verify that the check's actual behavior matches what it should do according to the vulnerability it's designed to detect.

packages/backend/src/checks/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import exposedEnvScan from "./exposed-env";
1919
import gitConfigScan from "./git-config";
2020
import hashDisclosureScan from "./hash-disclosure";
2121
import jsonHtmlResponseScan from "./json-html-response";
22+
import linkManipulationScan from "./link-manipulation";
2223
import missingContentTypeScan from "./missing-content-type";
2324
import openRedirectScan from "./open-redirect";
2425
import pathTraversalScan from "./path-traversal";
@@ -59,6 +60,7 @@ export const Checks = {
5960
GIT_CONFIG: "git-config",
6061
HASH_DISCLOSURE: "hash-disclosure",
6162
JSON_HTML_RESPONSE: "json-html-response",
63+
LINK_MANIPULATION: "link-manipulation",
6264
MISSING_CONTENT_TYPE: "missing-content-type",
6365
OPEN_REDIRECT: "open-redirect",
6466
PATH_TRAVERSAL: "path-traversal",
@@ -100,6 +102,7 @@ export const checks = [
100102
gitConfigScan,
101103
hashDisclosureScan,
102104
jsonHtmlResponseScan,
105+
linkManipulationScan,
103106
missingContentTypeScan,
104107
openRedirectScan,
105108
pathTraversalScan,

0 commit comments

Comments
 (0)