You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Santiago García Pimentel (JIRA)" <ji...@apache.org> on 2015/11/02 13:53:27 UTC

[jira] [Commented] (SLING-4701) SlingAuthenticator.isAnonAllowed matches for all paths starting with the same characters

    [ https://issues.apache.org/jira/browse/SLING-4701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14985172#comment-14985172 ] 

Santiago García Pimentel commented on SLING-4701:
-------------------------------------------------

[~kwin] brought to my attention that the documentation is not clear enough to tell if the current behavior is correct or not.
in https://sling.apache.org/documentation/the-sling-engine/authentication/authentication-authenticationhandler.html it implies that the check is just a string match. If this is correct, the current behavior is correct:
`When looking for an AuthenticationHandler the authentication handler is selected whose path is the longest match on the request URL `

then in  https://sling.apache.org/documentation/the-sling-engine/authentication/authentication-framework.html it says that each entry represent a subtree. In this case, the current behavior is wrong.
`Any entry prefixed with a dash - defines a subtree for which authentication is not required. Any entry not prefixed with a dash or prefixed with a plus + defines a subtree for which authentication is required up front and thus anonymous access is not allowed. This list is empty by default`

> 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)