fix(security): recognize localized Windows SYSTEM account in ACL audit#29698
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 23891964e8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| TRUSTED_SUFFIXES.some((suffix) => { | ||
| const strippedSuffix = suffix | ||
| .normalize("NFD") | ||
| .replace(/[\u0300-\u036f]/g, ""); | ||
| return stripped.endsWith(strippedSuffix); |
There was a problem hiding this comment.
Avoid trusting diacritic variants of privileged suffixes
The new diacritics fallback trusts any principal whose accent-stripped name ends with a trusted suffix, so non-privileged accounts like CORP\\Admīnistrators or CORP\\Système will now be classified as trusted even though they are not the built-in admin/SYSTEM identities. In environments where such similarly named domain/local principals exist, this can suppress fs.config.perms_writable findings and hide writable ACL exposure that was previously reported.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR fixes a false positive security audit issue on non-English Windows systems where the SYSTEM account has localized names. The implementation correctly addresses the problem through three complementary strategies:
The changes are well-tested with new test cases covering French, German, and Spanish variants, plus a full-scenario integration test. The diacritics-stripping logic is particularly clever, providing robustness against unknown locale variants while maintaining security. All formatting changes are automatic (likely from Prettier) and don't affect functionality. Confidence Score: 5/5
Last reviewed commit: 2389196 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bdf23c8504
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| TRUSTED_SUFFIXES.some((suffix) => { | ||
| const strippedSuffix = suffix | ||
| .normalize("NFD") | ||
| .replace(/[\u0300-\u036f]/g, ""); | ||
| return stripped.endsWith(strippedSuffix); |
There was a problem hiding this comment.
Limit accent-stripped trusted suffix matching to known principals
The diacritic fallback treats any principal whose accent-stripped name ends with a trusted suffix as trusted, so names like CORP\\Admīnistrators (or other accented variants of privileged suffixes) are now classified as trusted even when they are ordinary domain/local accounts. In inspectPathPermissions, those entries then drop out of untrustedGroup, which can suppress groupWritable/fs.config.perms_writable findings and hide writable ACL exposure on affected Windows environments.
Useful? React with 👍 / 👎.
bdf23c8 to
7bc3e6b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7bc3e6b0c2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ]); | ||
| const WORLD_SUFFIXES = ["\\users", "\\authenticated users"]; | ||
| const TRUSTED_SUFFIXES = ["\\administrators", "\\system"]; | ||
| const TRUSTED_SUFFIXES = ["\\administrators", "\\system", "\\système"]; |
There was a problem hiding this comment.
Restrict French SYSTEM suffix trust to built-in identity
Adding "\\système" to TRUSTED_SUFFIXES makes classifyPrincipal trust any ACL principal whose name ends with that suffix, not just the built-in SYSTEM account (for example, CORP\\Système). In Windows ACL audits, those entries are removed from untrustedGroup, which can suppress groupWritable/fs.config.perms_writable findings and hide writable ACL exposure on French-localized hosts where similarly named non-privileged accounts exist.
Useful? React with 👍 / 👎.
On non-English Windows (e.g. French "AUTORITE NT\Système"), the security audit falsely reports fs.config.perms_writable because the localized SYSTEM account name is not recognized as trusted. Changes: - Add common localized SYSTEM principal names (French, German, Spanish, Portuguese) to TRUSTED_BASE - Add diacritics-stripping fallback in classifyPrincipal for unhandled locales - Use well-known SID *S-1-5-18 in icacls reset commands instead of hardcoded "SYSTEM" string for locale independence Fixes openclaw#29681
7bc3e6b to
c9a275c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9a275cda4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| TRUSTED_SUFFIXES.some((suffix) => { | ||
| const strippedSuffix = suffix.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); | ||
| return stripped.endsWith(strippedSuffix); |
There was a problem hiding this comment.
Narrow diacritic trusted-suffix matching
This fallback now strips diacritics and then applies suffix trust to every entry in TRUSTED_SUFFIXES, so non-built-in principals like CORP\\Admīnistrators or CORP\\Système are reclassified as trusted. That is a regression from the previous behavior for accented lookalikes, and it can hide writable ACL findings because summarizeWindowsAcl removes those entries from untrustedGroup before audit-fs computes groupWritable. Fresh evidence in this commit is the new stripped-suffix check at this location, which newly broadens trust beyond exact localized SYSTEM names.
Useful? React with 👍 / 👎.
openclaw#29698) * fix(security): recognize localized Windows SYSTEM account in ACL audit On non-English Windows (e.g. French "AUTORITE NT\Système"), the security audit falsely reports fs.config.perms_writable because the localized SYSTEM account name is not recognized as trusted. Changes: - Add common localized SYSTEM principal names (French, German, Spanish, Portuguese) to TRUSTED_BASE - Add diacritics-stripping fallback in classifyPrincipal for unhandled locales - Use well-known SID *S-1-5-18 in icacls reset commands instead of hardcoded "SYSTEM" string for locale independence Fixes openclaw#29681 * style: format windows acl files --------- Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
#29698) * fix(security): recognize localized Windows SYSTEM account in ACL audit On non-English Windows (e.g. French "AUTORITE NT\Système"), the security audit falsely reports fs.config.perms_writable because the localized SYSTEM account name is not recognized as trusted. Changes: - Add common localized SYSTEM principal names (French, German, Spanish, Portuguese) to TRUSTED_BASE - Add diacritics-stripping fallback in classifyPrincipal for unhandled locales - Use well-known SID *S-1-5-18 in icacls reset commands instead of hardcoded "SYSTEM" string for locale independence Fixes #29681 * style: format windows acl files --------- Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
openclaw#29698) * fix(security): recognize localized Windows SYSTEM account in ACL audit On non-English Windows (e.g. French "AUTORITE NT\Système"), the security audit falsely reports fs.config.perms_writable because the localized SYSTEM account name is not recognized as trusted. Changes: - Add common localized SYSTEM principal names (French, German, Spanish, Portuguese) to TRUSTED_BASE - Add diacritics-stripping fallback in classifyPrincipal for unhandled locales - Use well-known SID *S-1-5-18 in icacls reset commands instead of hardcoded "SYSTEM" string for locale independence Fixes openclaw#29681 * style: format windows acl files --------- Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
openclaw#29698) * fix(security): recognize localized Windows SYSTEM account in ACL audit On non-English Windows (e.g. French "AUTORITE NT\Système"), the security audit falsely reports fs.config.perms_writable because the localized SYSTEM account name is not recognized as trusted. Changes: - Add common localized SYSTEM principal names (French, German, Spanish, Portuguese) to TRUSTED_BASE - Add diacritics-stripping fallback in classifyPrincipal for unhandled locales - Use well-known SID *S-1-5-18 in icacls reset commands instead of hardcoded "SYSTEM" string for locale independence Fixes openclaw#29681 * style: format windows acl files --------- Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
openclaw#29698) * fix(security): recognize localized Windows SYSTEM account in ACL audit On non-English Windows (e.g. French "AUTORITE NT\Système"), the security audit falsely reports fs.config.perms_writable because the localized SYSTEM account name is not recognized as trusted. Changes: - Add common localized SYSTEM principal names (French, German, Spanish, Portuguese) to TRUSTED_BASE - Add diacritics-stripping fallback in classifyPrincipal for unhandled locales - Use well-known SID *S-1-5-18 in icacls reset commands instead of hardcoded "SYSTEM" string for locale independence Fixes openclaw#29681 * style: format windows acl files --------- Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
openclaw#29698) * fix(security): recognize localized Windows SYSTEM account in ACL audit On non-English Windows (e.g. French "AUTORITE NT\Système"), the security audit falsely reports fs.config.perms_writable because the localized SYSTEM account name is not recognized as trusted. Changes: - Add common localized SYSTEM principal names (French, German, Spanish, Portuguese) to TRUSTED_BASE - Add diacritics-stripping fallback in classifyPrincipal for unhandled locales - Use well-known SID *S-1-5-18 in icacls reset commands instead of hardcoded "SYSTEM" string for locale independence Fixes openclaw#29681 * style: format windows acl files --------- Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
openclaw#29698) * fix(security): recognize localized Windows SYSTEM account in ACL audit On non-English Windows (e.g. French "AUTORITE NT\Système"), the security audit falsely reports fs.config.perms_writable because the localized SYSTEM account name is not recognized as trusted. Changes: - Add common localized SYSTEM principal names (French, German, Spanish, Portuguese) to TRUSTED_BASE - Add diacritics-stripping fallback in classifyPrincipal for unhandled locales - Use well-known SID *S-1-5-18 in icacls reset commands instead of hardcoded "SYSTEM" string for locale independence Fixes openclaw#29681 * style: format windows acl files --------- Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Fixes #29681
Problem
On non-English Windows (e.g. French
fr-FRlocale), the security audit reports a false positive forfs.config.perms_writablebecause the SYSTEM account is namedAUTORITE NT\Systèmeinstead ofNT AUTHORITY\SYSTEM. The ACL checker fails to recognize it as a trusted principal.Changes
TRUSTED_BASE: French (AUTORITE NT\Système), German (NT-AUTORITÄT\SYSTEM), Spanish (AUTORIDAD NT\SYSTEM), Portuguese (AUTORIDADE NT\SYSTEM)\systèmesuffix toTRUSTED_SUFFIXESfor French locale matchingclassifyPrincipal: normalizes Unicode (NFD + strip combining marks) and re-checks against trusted sets, catching any locale not explicitly listed*S-1-5-18informatIcaclsResetCommandandcreateIcaclsResetCommandinstead of hardcoded"SYSTEM"string — SID references work on all Windows localesTests