Skip to content

fix(detection): correct ESC15 and SchemaV1 detection boundaries - #91

Merged
jakehildreth merged 2 commits into
mainfrom
feature/esc15-schemav1-detection-cleanup
Jul 23, 2026
Merged

fix(detection): correct ESC15 and SchemaV1 detection boundaries#91
jakehildreth merged 2 commits into
mainfrom
feature/esc15-schemav1-detection-cleanup

Conversation

@jakehildreth

Copy link
Copy Markdown
Owner

Summary

This change separates the concerns of the ESC15 and SchemaV1 findings and fixes an incorrect mitigation recommendation.

  • ESC15 now correctly identifies exploitable schema v1 templates: enabled, with a Client Authentication EKU, and no authorized-signature requirement.
  • SchemaV1 now identifies enabled schema v1 templates that do not have a Client Authentication EKU, as an informational hygiene finding.

Key changes

  • Private/Data/ESCDefinitions.ps1

    • Removed ManagerApprovalNotRequired from ESC15 conditions. Schema v1 templates do not support manager approval; only permissions can be modified on them.
    • Added Enabled = $true to ESC15 conditions.
    • Replaced ESC15's FixTemplate/RevertTemplate with supersede guidance, matching SchemaV1.
    • Added AuthenticationEKUExist = $false to SchemaV1 conditions so ESC15 and SchemaV1 are mutually exclusive.
    • Removed incorrect "remove the Client Authentication EKU" advice from ESC15 issue text.
  • Tests/Public/Find-LS2VulnerableTemplate.Tests.ps1

    • Updated ESC15 mock to no longer set ManagerApprovalNotRequired.
    • Added negative tests for Enabled = $false (ESC15) and AuthenticationEKUExist = $true (SchemaV1).

Verification

  • ESCDefinitions.Tests.ps1 passes (structure/keys/scoring).
  • Find-LS2VulnerableTemplate.Tests.ps1 runs; failures on macOS are due to System.DirectoryServices.ActiveDirectorySecurity being Windows-only, unrelated to this change.

Related context

- update ESC15 conditions in Private/Data/ESCDefinitions.ps1:
  - remove ManagerApprovalNotRequired (v1 templates do not support it)
  - require Enabled = $true
  - keep AuthenticationEKUExist and AuthorizedSignatureNotRequired
- replace ESC15 fix/revert with SchemaV1-style supersede guidance
- update SchemaV1 conditions to exclude templates with client auth EKU
- update SchemaV1 issue text to clarify non-exploitable hygiene finding
- update Tests/Public/Find-LS2VulnerableTemplate.Tests.ps1 mocks and cases
  - remove ManagerApprovalNotRequired from ESC15 tests
  - add Enabled false negative test for ESC15
  - add AuthenticationEKUExist true negative test for SchemaV1
- fix typo "modifieed" -> "upgraded" in ESC15 FixTemplate
- switch ESC15 FixTemplate/RevertTemplate to single-quoted literals
- remove incorrect "remove Client Authentication EKU" advice from ESC15 issue text
- remove leftover ManagerApprovalNotRequired property from ESC15 test helper
@jakehildreth
jakehildreth merged commit d69b03c into main Jul 23, 2026
1 check passed
@jakehildreth
jakehildreth deleted the feature/esc15-schemav1-detection-cleanup branch August 3, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant