Why AI tools produce this: AI coding tools generate this anti-pattern by default, it appears in a large share of AI-written auth code.
Why this matters
Because anyRequest() is the catch-all matcher, this makes the entire application publicly accessible. Any endpoint, including state-changing and sensitive ones, can be reached without a logged-in user (CWE-862, broken access control). This is a common AI-generated Spring mistake: the default-allow line is pasted in to "make it work" and the intended access rules are never added.
Require authentication by default with anyRequest().authenticated(), and open only the specific public routes explicitly, e.g. requestMatchers("/public/**").permitAll(). Granting permitAll() on a specific matcher is fine; granting it on anyRequest() is not.
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.