Analyzes code to identify security-critical time intervals and timing vulnerabilities in authentication, authorization, and time-sensitive security operations. Use this skill when reviewing code for proper timeout enforcement, token expiration, session management, rate limiting, password reset validity, or any time-sensitive security mechanism. Detects missing expiration checks, excessive timeout values, lack of rate limiting, client-side only validation, hardcoded timeouts, and timing attack vulnerabilities. Triggers when users ask to check security timeouts, verify token expiration handling, audit session timeout implementation, review rate limiting, or analyze time-based security controls.
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill critical-interval-security-checker
Analyze code to identify security-critical time intervals and timing vulnerabilities that could compromise security.
Look for code that handles:
See vulnerability_patterns.md for detailed patterns.
Critical checks:
Run the automated checker script:
# Check single file
python scripts/check_intervals.py path/to/file.py
# Check entire directory
python scripts/check_intervals.py src/
# Specify language
python scripts/check_intervals.py src/ --language python
The script detects:
For each security-critical operation, verify:
Expiration is set:
# Good: Expiration set
token_expiry = datetime.utcnow() + timedelta(hours=1)
Expiration is checked:
# Good: Expiration validated
if datetime.utcnow() > token_expiry:
raise TokenExpiredError()
Timeout is reasonable:
# Good: 1-hour reset token
RESET_TOKEN_EXPIRY = timedelta(hours=1)
# Bad: 7-day reset token (too long!)
RESET_TOKEN_EXPIRY = timedelta(days=7)
Rate limiting exists:
# Good: Rate limited
@limiter.limit("5 per 15 minutes")
def login():
pass
Server-side enforcement:
# Good: Server validates expiration
decoded = jwt.decode(token, SECRET_KEY) # Checks exp
# Bad: Client-side only
decoded = jwt.decode(token, options={"verify_signature": False})
Consult time_intervals.md for recommended values:
Common intervals:
Check if intervals match use case:
For each issue found, document:
Issue: Missing expiration check on password reset token
Location: auth/reset_password.py:45
Severity: High
Current: Token created with expiry but never validated
Recommendation: Add expiration check before using token
Code fix:
if datetime.utcnow() > token.expires_at:
raise TokenExpiredError("Reset token expired")
Fix missing expiration checks:
# Before
def validate_token(token):
decoded = jwt.decode(token, SECRET_KEY, options={"verify_signature": False})
return decoded['user_id']
# After
def validate_token(token):
try:
decoded = jwt.decode(token, SECRET_KEY) # Verifies exp automatically
return decoded['user_id']
except jwt.ExpiredSignatureError:
raise AuthenticationError("Token expired")
Fix excessive timeouts:
# Before
RESET_TOKEN_EXPIRY = timedelta(days=7) # Too long!
# After
RESET_TOKEN_EXPIRY = timedelta(hours=1) # Appropriate
Add rate limiting:
# Before
@app.route('/login', methods=['POST'])
def login():
pass
# After
@app.route('/login', methods=['POST'])
@limiter.limit("5 per 15 minutes")
def login():
pass
Fix hardcoded timeouts:
# Before
expiry = datetime.utcnow() + timedelta(seconds=3600) # Magic number
# After
SESSION_TIMEOUT = timedelta(hours=1) # Named constant
expiry = datetime.utcnow() + SESSION_TIMEOUT
Missing expiration check:
No rate limiting:
Client-side only validation:
Excessive timeouts:
Python:
# Look for
jwt.decode(..., verify=False) # Bad
timedelta(days=7) # Check context
@limiter.limit # Good
datetime.now() vs datetime.utcnow() # Timezone issue
JavaScript:
// Look for
jwt.decode(...) // Check if expiration validated
Date.now() < exp // Client-side check
rateLimit(...) // Good
setTimeout(..., 86400000) // Magic number
Java:
// Look for
Jwts.parser() // Check if expiration validated
Duration.ofDays(30) // Check context
@RateLimit // Good
The check_intervals.py script automates detection:
# Check Python code
python scripts/check_intervals.py src/ --language python
# Check JavaScript code
python scripts/check_intervals.py src/ --language javascript
# Auto-detect language
python scripts/check_intervals.py src/
Output provides:
Always:
Never:
Expert in secure backend coding practices specializing in input validation, authentication, and API security. Use PROACTIVELY for backend security implementations or security code reviews.
This skill should be used when the user asks to "perform cloud penetration testing", "assess Azure or AWS or GCP security", "enumerate cloud resources", "exploit cloud misconfigurations", "test O365 security", "extract secrets from cloud environments", or "audit cloud infrastructure". It provides comprehensive techniques for security assessment across major cloud platforms.
You are a dependency security expert specializing in vulnerability scanning, license compliance, and supply chain security. Analyze project dependencies for known vulnerabilities, licensing issues, outdated packages, and provide actionable remediation strategies.
Comprehensive Flow Nexus platform management - authentication, sandboxes, app deployment, payments, and challenges
This skill should be used when the user asks to "escalate privileges on Linux", "find privesc vectors on Linux systems", "exploit sudo misconfigurations", "abuse SUID binaries", "exploit cron jobs for root access", "enumerate Linux systems for privilege escalation", or "gain root access from low-privilege shell". It provides comprehensive techniques for identifying and exploiting privilege escalation paths on Linux systems.
Expert malware analyst specializing in defensive malware research, threat intelligence, and incident response. Masters sandbox analysis, behavioral analysis, and malware family identification. Handles static/dynamic analysis, unpacking, and IOC extraction. Use PROACTIVELY for malware triage, threat hunting, incident response, or security research.
This skill should be used when the user asks to "use Metasploit for penetration testing", "exploit vulnerabilities with msfconsole", "create payloads with msfvenom", "perform post-exploitation", "use auxiliary modules for scanning", or "develop custom exploits". It provides comprehensive guidance for leveraging the Metasploit Framework in security assessments.
Expert in secure mobile coding practices specializing in input validation, WebView security, and mobile-specific security patterns. Use PROACTIVELY for mobile security implementations or mobile security code reviews.
Take arabelatso/critical-interval-security-checker from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.