- Add RateLimitConfig for configuration management with YAML binding support. - Introduce RateLimitDecision to encapsulate the result of rate limit checks. - Implement RateLimitMetrics for OpenTelemetry metrics tracking. - Create RateLimitMiddleware for enforcing rate limits on incoming requests. - Develop RateLimitService to orchestrate instance and environment rate limit checks. - Add RateLimitServiceCollectionExtensions for dependency injection registration.
23 lines
526 B
C
23 lines
526 B
C
// gt-0002: Two-hop call chain to vulnerable sink
|
|
// Expected: REACHABLE (tier: executed)
|
|
// Vulnerability: CWE-134 (Format String)
|
|
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
void format_message(const char *user_input, char *output) {
|
|
// Vulnerable: format string from user input
|
|
sprintf(output, user_input); // SINK: CWE-134
|
|
}
|
|
|
|
int main(int argc, char *argv[]) {
|
|
char buffer[256];
|
|
|
|
if (argc > 1) {
|
|
format_message(argv[1], buffer);
|
|
printf("Result: %s\n", buffer);
|
|
}
|
|
|
|
return 0;
|
|
}
|