API Rate Limiting
Implements API rate limiting strategies to prevent abuse and manage traffic effectively, ensuring optimal performance and security.
Install this skill
Security score
The API Rate Limiting skill was audited on Mar 1, 2026 and we found 31 security issues across 1 threat category. Review the findings below before installing.
Categories Tested
Security Issues
Template literal with variable interpolation in command context
| 266 | throw new Error(`Rate limit rule ${name} not found`); |
Template literal with variable interpolation in command context
| 300 | keyGenerator: (context) => context.userId || `anonymous_${context.ipAddress}`, |
Template literal with variable interpolation in command context
| 334 | keyGenerator: (context) => context.userId || `anonymous_${context.ipAddress}`, |
Template literal with variable interpolation in command context
| 372 | throw new Error(`Rate limiting algorithm ${rule.algorithm} not found`); |
Template literal with variable interpolation in command context
| 417 | console.error(`Error checking rate limit for rule ${ruleName}:`, error); |
Template literal with variable interpolation in command context
| 443 | return context.userId || `anonymous_${context.ipAddress}`; |
Template literal with variable interpolation in command context
| 449 | return `${context.requestId}_${context.timestamp}`; |
Template literal with variable interpolation in command context
| 457 | const penaltyKey = `${key}_penalty`; |
Template literal with variable interpolation in command context
| 474 | console.log(`Applied rate limit penalty to ${key}: ${newPenalty} violations, duration: ${penaltyDuration}ms`); |
Template literal with variable interpolation in command context
| 537 | return `req_${Date.now()}_${Math.random().toString(36).substring(7)}`; |
Template literal with variable interpolation in command context
| 614 | const data = await this.redis.get(`bucket:${key}`); |
Template literal with variable interpolation in command context
| 619 | await this.redis.setex(`bucket:${key}`, Math.ceil(bucket.window / 1000), JSON.stringify(bucket)); |
Template literal with variable interpolation in command context
| 623 | await this.redis.del(`bucket:${key}`); |
Template literal with variable interpolation in command context
| 627 | const requests = await this.redis.zrangebyscore(`requests:${key}`, since, '+inf'); |
Template literal with variable interpolation in command context
| 632 | await this.redis.zadd(`requests:${key}`, timestamp, timestamp); |
Template literal with variable interpolation in command context
| 633 | await this.redis.expire(`requests:${key}`, 3600); // 1 hour expiry |
Template literal with variable interpolation in command context
| 637 | await this.redis.del(`requests:${key}`); |
Template literal with variable interpolation in command context
| 641 | const count = await this.redis.get(`window:${key}:${window}`); |
Template literal with variable interpolation in command context
| 646 | const count = await this.redis.incr(`window:${key}:${window}`); |
Template literal with variable interpolation in command context
| 647 | await this.redis.expire(`window:${key}:${window}`, Math.ceil(window / 1000) + 60); |
Template literal with variable interpolation in command context
| 651 | await this.redis.del(`window:${key}:*`); |
Template literal with variable interpolation in command context
| 655 | const data = await this.redis.get(`penalty:${key}`); |
Template literal with variable interpolation in command context
| 660 | await this.redis.setex(`penalty:${key}`, Math.ceil((penalty.expiresAt - Date.now()) / 1000), JSON.stringify(penalty)); |
Template literal with variable interpolation in command context
| 664 | await this.redis.del(`penalty:${key}`); |
Template literal with variable interpolation in command context
| 703 | return this.windows.get(`${key}:${window}`) || 0; |
Template literal with variable interpolation in command context
| 707 | const current = this.windows.get(`${key}:${window}`) || 0; |
Template literal with variable interpolation in command context
| 708 | this.windows.set(`${key}:${window}`, current + 1); |
Template literal with variable interpolation in command context
| 714 | if (windowKey.startsWith(`${key}:`)) { |
Template literal with variable interpolation in command context
| 824 | message: `High block rate: ${(blockRate * 100).toFixed(2)}%`, |
Template literal with variable interpolation in command context
| 836 | message: `Excessive violations from ${topViolator.key}: ${topViolator.violations}`, |
Template literal with variable interpolation in command context
| 847 | message: `High average response time: ${this.metrics.averageResponseTime.toFixed(2)}ms`, |
Install this skill with one command
/learn @coverage-creatives/api-rate-limiting