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

Config auditor false negative #1482

Open
kethinov opened this issue Jan 19, 2025 · 0 comments
Open

Config auditor false negative #1482

kethinov opened this issue Jan 19, 2025 · 0 comments
Assignees
Labels

Comments

@kethinov
Copy link
Member

An obscure situation can be triggered to cause the config auditor to pass when it shouldn't.

This was observed with the csrfProtection config defined in this old commit:

case 'csrfProtection':
checkTypes(userParam, key, ['boolean'])
break

In that config schema from that old commit, csrfProtection expects to only receive boolean config values, which was a bug that has since been fixed. However, while debugging, we noticed odd behavior that reveals a deeper bug.

If you change the config auditor back to only accept booleans for csrfProtection, then configure a Roosevelt app config in certain ways, the config audit won't fail in cases where it should.

Example configs:

If you configure a Roosevelt app config with:

"csrfProtection": {
  "exemptions": [
    "/login/openid",
    "/login/openid/auth"
  ]
},

It will not fail the config auditor, even though it should, because an object is not a boolean.

However if you give the app this config instead:

"csrfProtection": {
  "exemptions": [
    "/verify"
  ]
},

That will fail the config auditor. It's unclear why the two exemptions objects with different entries trigger different behavior.

@kethinov kethinov added the bug label Jan 19, 2025
@kethinov kethinov self-assigned this Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant