Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Expected Behavior:
In environments with multiple web enrollment endpoints, the ESC8 vulnerability is only shown for the specific endpoint it was identified on.
Observed Behavior:
In environments with multiple CAs with web enrollment endpoints, if one CA has a vulnerable endpoint and the others do not, ESC8 shows up for all of the endpoints checked after it in the Foreach-Object loop.
Reproducing:
Setup two CAs, one with a vulnerable CA and one with a non-vulnerable CA. The Non-vulnerable CA should be alphabetically after the vulnerable CA so that it ends up after the vulnerable CA in the looping of $ADCSObject
Cause:
Currently, the $CAEnrollmentEndpoint array is in the begin{} block in the Set-AdditionalCAProperty function. Objecs in the begin{} block are scoped for the entire function.
Moving the instantiation to the Foreach-Object loop where the Enrollment Endpoints in $ADCSObject are being iterated solves the issue. This creates a new, empty array for each CA rather than re-using the previous array. I believe this is the desired behavior.