Accounts With Passwords That Never Expire
Accounts are exempt from password expiry, so passwords set years ago, often on service and administrative accounts, stay valid however widely they have been exposed.
| Severity | Low |
| CVSS 3.1 | 3.7 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N Open in the calculator |
| CVSS 4.0 | 6.3 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-262: Not Using Password Aging |
| MITRE ATT&CK | T1078.002 Domain Accounts |
| Category | Security Misconfiguration |
Description
The Password never expires option (the DONT_EXPIRE_PASSWORD flag, value 0x10000, in userAccountControl) exempts an account from the maximum password age in the domain's password policy. It is commonly set on service accounts, so that a password change cannot break the services that use them, and on administrative, shared and test accounts for convenience.
Current guidance from the UK NCSC and NIST advises against forcing regular expiry of user passwords, because it encourages predictable passwords. The concern with this finding is therefore not the flag itself, which does not disclose a password and so keeps the rating low, but what it typically hides: passwords that have not changed for years (shown by pwdLastSet), were set before the current password policy, are known to former staff or suppliers, or appear in old scripts and documentation, often on accounts with high privileges.
A password that never has to change remains valid however it is exposed: cracked offline from a Kerberos service ticket, recovered from a script or share, reused from a breach, or remembered by someone who has left. With no expiry and no review, an attacker who obtains such a password, or an insider who already knows it, can keep using it indefinitely. For an ordinary user this is limited to that user's access, but these accounts are frequently service or administrative accounts, where it can extend to control of the systems they run or of the domain.
Any domain user can list the accounts with the LDAP filter (userAccountControl:1.2.840.113556.1.4.803:=65536) or with Get-ADUser -Filter 'PasswordNeverExpires -eq $true' -Properties PasswordLastSet, and compare their password ages.
Remediation
- Replace service accounts with group managed service accounts (gMSAs) wherever the service supports them. The domain sets and changes their long random passwords automatically, so the flag is not needed.
- For service accounts that cannot use a gMSA, set a long, randomly generated password and change it on a schedule and whenever someone who knew it leaves, coordinating the change with the services that use it.
- For user and administrative accounts, apply the same password policy as everyone else rather than exempting individual accounts. Where the organisation follows current guidance and does not force expiry, rely on long passwords, a banned password list and multi-factor authentication instead, and require a change whenever compromise is suspected.
- Change the passwords of accounts whose
pwdLastSetpredates the current password policy or the departure of staff who knew them, starting with privileged accounts. - Record an owner and a justification for every account that keeps the flag, and review the list regularly.
Confirm the fix by running the query again and checking that each remaining account is documented and has a recent pwdLastSet value.
References
- learn.microsoft.com/en-us/troubleshoot/windows-server/active-directory/useraccountcontrol-manipulate-account-properties
- learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/group-managed-service-accounts/group-managed-service-accounts/group-managed-service-accounts-overview
- attack.mitre.org/techniques/T1078/002
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.