What does Windows error code 1337 (ERROR_INVALID_SID) mean?

 
Previous Next
ERROR_INVALID_ACL ERROR_INVALID_SECURITY_DESCR

ERROR_INVALID_SID

ERROR_INVALID_SID (1337, 0x00000539) means that a security identifier has an invalid binary form. It is not merely a failed account-name lookup.

SID validation and lookup are separate

IsValidSid verifies structural properties of a SID, including a known revision and a permitted number of subauthorities. A structurally valid SID can still have no corresponding account name; that different situation is reported as ERROR_NONE_MAPPED by lookup functions.

What to check

  • Do not construct variable-length SID buffers by hand when a documented creation or conversion API can be used.
  • Validate the SID before adding it to an ACL, a token-related structure, or a security descriptor.
  • Ensure that serialized or remote input has the expected ownership and length before casting it to PSID.
  • Log a string representation only after validation, so diagnostic code does not dereference malformed memory.

See Microsoft documentation for IsValidSid and security identifiers.


Looking for a different code? Search another status or error code.