-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
enhancementNew feature or requestNew feature or requestsecuritySecurity improvements and vulnerability fixesSecurity improvements and vulnerability fixes
Description
The template cache in internal/parser/cache.go has no size limit or eviction policy, creating a potential memory exhaustion vulnerability.
Issue
Dynamic template generation could cause unbounded memory growth:
for i := 0; i < 1000000; i++ {
logger.Info(fmt.Sprintf("User %d: {Action}", i), "login")
}Solution
Implement an LRU cache with:
- Configurable max size (default: 10,000 templates)
- O(1) get/put operations
- Optional TTL support
- Cache hit/miss metrics for monitoring
Benefits
- Prevents memory exhaustion
- Predictable memory usage
- Better performance insights via metrics
- Production-ready for 1.0 release
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestsecuritySecurity improvements and vulnerability fixesSecurity improvements and vulnerability fixes