[
https://issues.apache.org/jira/browse/SLING-4701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14978408#comment-14978408
]
Santiago GarcĂa Pimentel commented on SLING-4701:
-------------------------------------------------
I stumble with the same issue and didn't realize there was already a ticket for
this.
I've also created a fix for this. I think Lars patch doesn't take into
consideration the case where the path matches exactly (without trailing slash).
I created a isWithin method in the PathBasedHolder to encapsulate the logic
there.
https://github.com/apache/sling/pull/109
> SlingAuthenticator.isAnonAllowed matches for all paths starting with the same
> characters
> ----------------------------------------------------------------------------------------
>
> Key: SLING-4701
> URL: https://issues.apache.org/jira/browse/SLING-4701
> Project: Sling
> Issue Type: Bug
> Components: Authentication
> Affects Versions: Auth Core 1.3.6
> Reporter: Lars Krapf
> Labels: authentication
> Attachments: SlingAuthenticator.patch
>
>
> The SlingAuthenticator check if anonymous access is allowed compares paths
> with String.startsWith. If the holder.path does not end with a '/' it will
> erroneously match a different path that starts with the same characters, even
> if it is not a descendant of the first path.
> Example:
> - Allow anonymous acces on '/'
> - Deny anonymous access on a path '/blubb'
> -> Authentication is enforced on a request to '/blubb-blah' - which is wrong.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)