packagist damienharper/auditor-bundle 7.2.2

latest release: 6.3.1
2 hours ago

auditor-bundle 7.2.2

🔒 Security

Anonymous access to role-restricted entity audits

Advisory: GHSA-96g2-mf57-639h

The default role checker granted access as soon as no user was identified, before looking at the
roles configured for the entity. An unauthenticated visitor could therefore list and read the audit
history of entities restricted with #[Security(view: [...])] (or the roles option of the entity
configuration), as long as the viewer route was reachable without logging in.

Roles are now checked first: an entity without roles stays accessible as before, and access to an
entity with roles is denied when no user is identified.

All users exposing the audit viewer are encouraged to upgrade. Applications that protect the viewer
routes with a firewall or an access_control rule requiring authentication were not exposed.

Reported by @Scwaall in #621, fixed by @Gumbraise in #630.


⚠️ Upgrade notes

Reading role-restricted audits without a user is now denied

The role checker is also used by the Reader of auditor-doctrine-provider, not only by the viewer.
Code that reads the audits of a role-restricted entity without an authenticated user (a console
command, a scheduled export, a Messenger handler…) used to be granted access, and now gets an
AccessDeniedException. Entities without roles are not affected.

If such code must read restricted audits, configure your own role checker for that context:

dh_auditor:
    role_checker: 'App\Audit\CustomRoleChecker'

What's Changed

Security

Maintenance

  • fix: drop the always-true authorization checker check in RoleChecker by @DamienHarper in #652 (no behaviour change, fixes the PHPStan step of the CI)
  • fix(ci): freeze the published major docs on X.0.0 tags by @DamienHarper in #650
  • chore: update CI workflow and branch-alias for 7.x maintenance branch

References

Full Changelog: 7.2.1...7.2.2

Don't miss a new auditor-bundle release

NewReleases is sending notifications on new releases.