Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request from GHSA-pmw9-567p-68pc
Browse files Browse the repository at this point in the history
Co-authored-by: Oliver Geiselhardt-Herms <ogeiselhardt-herms@cloudflare.com>
  • Loading branch information
takt and Oliver Geiselhardt-Herms authored Oct 18, 2022
1 parent 10191d9 commit 5f64bcd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmd/octorpki/octorpki.go
Original file line number Diff line number Diff line change
Expand Up @@ -1234,10 +1234,6 @@ func (s *OctoRPKI) validationLoop() {

s.stats.Iteration++
iterationsUntilStable++
// GHSA-g5gj-9ggf-9vmq: Prevent infinite repository traversal
if iterationsUntilStable > *MaxIterations {
log.Fatal("Max iterations has been reached. This number can be adjusted with -max.iterations")
}
span.SetTag("iteration", s.stats.Iteration)

if *RRDP {
Expand All @@ -1264,6 +1260,13 @@ func (s *OctoRPKI) validationLoop() {
span.SetTag("stable", s.Stable.Load())
span.Finish()

// GHSA-g5gj-9ggf-9vmq: Prevent infinite repository traversal
if iterationsUntilStable > *MaxIterations {
// GHSA-pmw9-567p-68pc: Do not crash when MaxIterations is reached
log.Warning("Max iterations has been reached. Defining current state as stable and stoppping deeper validation. This number can be adjusted with -max.iterations")
s.Stable.Store(true)
}

if *Mode == "oneoff" && s.Stable.Load() {
log.Info("Stable, terminating")
break
Expand Down

0 comments on commit 5f64bcd

Please # to comment.