Skip to content

bcdedit /set failure path still reports result as Passed #209

Description

@grisutheguru

Summary

In the bcdedit branch, the catch block sets the result to Failed, but the code immediately afterwards unconditionally overwrites it with the "Setting enabled ... Passed" result. A failed bcdedit /set is therefore reported as successful.

Affected code (HardeningKitty.psm1, commit 9fee160, v0.9.4)

  • bcdedit /set call at line 2956
  • catch sets TestResult = "Failed" at lines 2958-2962
  • unconditional MessageSeverity/TestResult = "Passed" at lines 2967-2970

Impact

False-positive hardening confirmation for boot-configuration settings.

Recommendation

Skip the success path after a caught error (e.g. set a flag and Continue), and evaluate $LASTEXITCODE of bcdedit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions