Skip to content

Commit

Permalink
Introduced protections against predictable RNG abuse (#8)
Browse files Browse the repository at this point in the history
Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
  • Loading branch information
pixeeai and pixeebot[bot] committed Sep 29, 2024
1 parent 264cf6d commit ab46e5a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.airbyte.api.client.model.generated.ConnectionScheduleType;
import io.micronaut.context.annotation.Value;
import jakarta.inject.Singleton;
import java.security.SecureRandom;
import java.time.Duration;
import java.util.Random;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -62,7 +63,7 @@ public Duration addJitterBasedOnWaitTime(final Duration waitTime, final Connecti
}

final int jitterSeconds;
final Random random = new Random();
final Random random = new SecureRandom();

// CRON schedules should not have negative jitter included, because then it is possible for the sync
// to start and finish before the real scheduled time. This can result in a double sync because the
Expand Down

0 comments on commit ab46e5a

Please sign in to comment.