You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AWS CloudWatch: GetMetricData Period is not validated (overflow can hang or crash the server) #1701
GetMetricData never validates the Period of a MetricDataQuery or MetricStat. A huge Period overflows time.Duration(p)*time.Second, so the step becomes negative or zero. A negative step makes the fill loop never end, and the handler keeps burning CPU and memory. A zero step panics with a divide by zero. This came up while reviewing #1537, which makes it reachable through a SEARCH period too.
Goal: validate Period as AWS does (a positive multiple of 60, or 1, 5, 10, 20 or 30 for high resolution, within the API limits). Return InvalidParameterValue when it is out of range, and guard the step computation (count in seconds, reject a non-positive step), with a regression test.
Activity