Skip to content

Conversation

@cybersreejith
Copy link
Collaborator

No description provided.

@cybersreejith
Copy link
Collaborator Author

Add ResourcesAndRateLimitingTestCase for OWASP API4:2023

Implements automated testing for Unrestricted Resource Consumption (API4:2023) according to the OWASP API Security Top 10 2023. This test case detects:

  • Missing rate limiting mechanisms through concurrent request testing
  • Unbounded result sets and lack of pagination in collection endpoints
  • Acceptance of excessively large request payloads
  • Susceptibility to resource-intensive operations (GraphQL complexity, expensive search patterns)

Each vulnerability is reported with severity rating and remediation guidance.

@GovindarajanL GovindarajanL linked an issue Mar 10, 2025 that may be closed by this pull request
4 tasks
}

try {
String fullUrl = "https://example.com" + endpoint.getPath();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fullUrl variable is hardcoded with "https://example.com". This should be replaced with a mechanism to use the target URL from the scan configuration.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

long responseTime = endTime - startTime;

// If the response time is very high, it might indicate an expensive operation
if (responseTime > 5000) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The search test uses a fixed response time threshold (5 seconds). This could be made configurable or adjusted based on typical API response times.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

private static final Logger logger = LogManager.getLogger(ResourcesAndRateLimitingTestCase.class);

// Thresholds for testing
private static final int RATE_LIMIT_TEST_REQUESTS = 20;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These hard coding part, we need to see how we can make it configurable

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TEST] Implement Resources & Rate Limiting (API4:2023) Test Case

2 participants