Skip to content

fix(security): recognize localized Windows SYSTEM account in ACL audit#29698

Merged
Takhoffman merged 2 commits intoopenclaw:mainfrom
ningding97:fix/windows-acl-localized-system
Mar 2, 2026
Merged

fix(security): recognize localized Windows SYSTEM account in ACL audit#29698
Takhoffman merged 2 commits intoopenclaw:mainfrom
ningding97:fix/windows-acl-localized-system

Conversation

@ningding97
Copy link

Fixes #29681

Problem

On non-English Windows (e.g. French fr-FR locale), the security audit reports a false positive for fs.config.perms_writable because the SYSTEM account is named AUTORITE NT\Système instead of NT AUTHORITY\SYSTEM. The ACL checker fails to recognize it as a trusted principal.

Changes

  • Add localized SYSTEM names to TRUSTED_BASE: French (AUTORITE NT\Système), German (NT-AUTORITÄT\SYSTEM), Spanish (AUTORIDAD NT\SYSTEM), Portuguese (AUTORIDADE NT\SYSTEM)
  • Add \système suffix to TRUSTED_SUFFIXES for French locale matching
  • Diacritics-stripping fallback in classifyPrincipal: normalizes Unicode (NFD + strip combining marks) and re-checks against trusted sets, catching any locale not explicitly listed
  • Use SID *S-1-5-18 in formatIcaclsResetCommand and createIcaclsResetCommand instead of hardcoded "SYSTEM" string — SID references work on all Windows locales

Tests

  • Added tests for French, German, Spanish localized SYSTEM classification
  • Added full-scenario test (French user + Système = all trusted)
  • Added test verifying SID usage in reset commands
  • All 40 tests pass

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +119 to +123
TRUSTED_SUFFIXES.some((suffix) => {
const strippedSuffix = suffix
.normalize("NFD")
.replace(/[\u0300-\u036f]/g, "");
return stripped.endsWith(strippedSuffix);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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-apps
Copy link
Contributor

greptile-apps bot commented Feb 28, 2026

Greptile Summary

This 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:

  • Explicit localized names: Adds French (AUTORITE NT\Système), German (NT-AUTORITÄT\SYSTEM), Spanish (AUTORIDAD NT\SYSTEM), and Portuguese (AUTORIDADE NT\SYSTEM) to the trusted base set
  • Diacritics-stripping fallback: Implements Unicode normalization (NFD) to handle locale variants not explicitly listed by stripping combining diacritical marks and rechecking against trusted patterns
  • SID-based reset commands: Uses the locale-independent SID *S-1-5-18 instead of the hardcoded string "SYSTEM" in icacls reset commands, ensuring commands work across all Windows locales

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

  • This PR is safe to merge with minimal risk
  • The implementation is sound and well-tested. The three-pronged approach (explicit localized names, diacritics fallback, and SID usage) correctly handles the Windows localization issue. The diacritics-stripping logic using NFD normalization is properly implemented to catch edge cases. All 40 tests pass, including new tests specifically for the localized variants. The changes are backwards-compatible and don't modify any existing security assumptions. The only formatting changes are automatic and don't introduce any functional issues.
  • No files require special attention

Last reviewed commit: 2389196

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +119 to +123
TRUSTED_SUFFIXES.some((suffix) => {
const strippedSuffix = suffix
.normalize("NFD")
.replace(/[\u0300-\u036f]/g, "");
return stripped.endsWith(strippedSuffix);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@Takhoffman Takhoffman force-pushed the fix/windows-acl-localized-system branch from bdf23c8 to 7bc3e6b Compare March 2, 2026 13:55
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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"];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

ningding97 and others added 2 commits March 2, 2026 08:33
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
@Takhoffman Takhoffman force-pushed the fix/windows-acl-localized-system branch from 7bc3e6b to c9a275c Compare March 2, 2026 14:38
@Takhoffman Takhoffman merged commit 944abe0 into openclaw:main Mar 2, 2026
6 checks passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +115 to +117
TRUSTED_SUFFIXES.some((suffix) => {
const strippedSuffix = suffix.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
return stripped.endsWith(strippedSuffix);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

hanqizheng pushed a commit to hanqizheng/openclaw that referenced this pull request Mar 2, 2026
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>
obviyus pushed a commit that referenced this pull request Mar 2, 2026
#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>
Linux2010 pushed a commit to Linux2010/openclaw that referenced this pull request Mar 2, 2026
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>
execute008 pushed a commit to execute008/openclaw that referenced this pull request Mar 2, 2026
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>
dawi369 pushed a commit to dawi369/davis that referenced this pull request Mar 3, 2026
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>
OWALabuy pushed a commit to kcinzgg/openclaw that referenced this pull request Mar 4, 2026
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>
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: security audit: fs.config.perms_writable false positive on French Windows (localized SYSTEM account name not recognized)

2 participants