Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positives when excluding paths for CSRF #263

Open
14nd90 opened this issue May 7, 2024 · 1 comment
Open

False positives when excluding paths for CSRF #263

14nd90 opened this issue May 7, 2024 · 1 comment

Comments

@14nd90
Copy link

14nd90 commented May 7, 2024

I have this definition in my-theme/app/Middleware/VerifyNonce.php:
public $except = [ 'admin/stats/report' ];

But I noticed that this exception was getting applied where I was not expecting it, like admin/accounts/type/filtered

I took a dive and the issue is in the excludePath() function in BaseVerify.php where it fails this condition:
if( count($explodedPath) == count($exclude) ) {

I believe this to be a bug - since now any route which isn't 3 parts will be excluded.

@kevindees
Copy link
Member

This is being fixed in the next major release of v6. That version will require PHP 8.2+.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants