fix(resourceexplorer2): reject invalid pagination tokens (#3444)

This commit is contained in:
Franklin G. Mendoza authored and GitHub committed 2026-09-11 22:37:57 -04:00
1 parent 128d3ef181
commit f482a2d15e
3 files changed
+30 -6

No files matched your search

@@ -999,10 +999,14 @@ public class ResourceExplorer2Service {
return 0;
}
try {
return Integer.parseInt(new String(Base64.getDecoder().decode(token)));
int offset = Integer.parseInt(new String(Base64.getDecoder().decode(token)));
if (offset < 0) {
throw new IllegalArgumentException("negative offset");
}
return offset;
} catch (Exception e) {
LOG.debugf("Invalid NextToken '%s', restarting from offset 0: %s", token, e.getMessage());
return 0;
throw new AwsException("ValidationException",
"NextToken is invalid or has expired.", 400);
}
}