You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have verified this is the correct repository for opening this issue.
I have verified no other issues exist related to my problem.
I have verified this is not an issue for a specific package.
I have verified this issue is not security related.
I confirm I am using official, and not unofficial, or modified, Chocolatey products.
What You Are Seeing?
When the permissions on the httpcache folder are changed, Chocolatey CLI shows the following validation warning:
System Cache directory is not locked down to administrators. Remove the directory 'C:\ProgramData\ChocolateyHttpCache' to have Chocolatey CLI create it with the proper permissions.
When trying to resolve this warning, the user ran an Advanced Deployment Step in Chocolatey Central Management to remove the httpcache folder and have Chocolatey CLI recreate it. Chocolatey CLI creates the cache folder, with all local machine users having write access to the folder. This permission change causes the recreated httpcache folder to report the same issue of the folder not being locked down to just Administrator user access.
What is Expected?
Chocolatey should be able to recreate this folder with the correct permissions. Chocolatey should be setting the cache folder's ACL before every run of Chocolatey.
How Did You Get This To Happen?
Install Chocolatey for Business and license it. Note the current permissions on C:\ProgamData\ChocolateyHttpCache folder.
Go to the C:\ProgamData\ChocolateyHttpCache folder and edit the permissions to add LocalMachine\Users object to include Write access.
Run choco list and the validation warning mentioned above, should be shown.
Undo the folder permissions change done in Step 2.
You should notice that the C:\ProgamData\ChocolateyHttpCache folder has been re-created. However, Users now have Write access, and the CREATOR OWNER has Full Control rights. If you run choco list again, you get the same validation warning message.
System Details
Operating System: 20348.3091 (Windows Server 2022)
Windows PowerShell Version: 5.1.20348.2849
Chocolatey CLI Version: 2.4.2
Chocolatey Licensed Extension version: 6.3.1
Chocolatey Agent version: 2.2.2
Chocolatey License type (Professional / Business / ?): Business
Terminal/Emulator: Windows PowerShell & Chocolatey Central Management
Adding the following to the PowerShell of the Advanced Deployment Step in the reproduction steps of this issue will programmatically recreate the cache folder, mirroring the ACLs from $env:ChocolateyInstall onto it.
Additional information. The cause of this is because we are locking down the Http Folder as part of running one of the Validations (CacheFolderValidationLockdown).
These validations are not run when the API is being used, which causes NuGet.Client itself to create the directory, which is then created with the incorrect permissions.
pauby
changed the title
Chocolaety CLI is incorrectly reporting bad permissions on the HttpCache folder and is not setting them correctly
Chocolatey CLI is incorrectly reporting bad permissions on the HttpCache folder and is not setting them correctly
Mar 3, 2025
Checklist
What You Are Seeing?
When the permissions on the
httpcache
folder are changed, Chocolatey CLI shows the following validation warning:When trying to resolve this warning, the user ran an Advanced Deployment Step in Chocolatey Central Management to remove the
httpcache
folder and have Chocolatey CLI recreate it. Chocolatey CLI creates the cache folder, with all local machine users having write access to the folder. This permission change causes the recreatedhttpcache
folder to report the same issue of the folder not being locked down to just Administrator user access.What is Expected?
Chocolatey should be able to recreate this folder with the correct permissions. Chocolatey should be setting the cache folder's ACL before every run of Chocolatey.
How Did You Get This To Happen?
C:\ProgamData\ChocolateyHttpCache
folder.C:\ProgamData\ChocolateyHttpCache
folder and edit the permissions to addLocalMachine\Users
object to include Write access.choco list
and the validation warning mentioned above, should be shown.C:\ProgamData\ChocolateyHttpCache
folder has been re-created. However,Users
now haveWrite
access, and theCREATOR OWNER
hasFull Control
rights. If you runchoco list
again, you get the same validation warning message.System Details
Installed Packages
Output Log
Additional Context
Adding the following to the PowerShell of the Advanced Deployment Step in the reproduction steps of this issue will programmatically recreate the cache folder, mirroring the ACLs from
$env:ChocolateyInstall
onto it.The text was updated successfully, but these errors were encountered: