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

[SHIRO-742]fix throw exception when request uri is / #201

Merged
merged 1 commit into from Feb 13, 2020

Conversation

tomsun28
Copy link
Contributor

@tomsun28 tomsun28 commented Feb 8, 2020

this bug due to my pr SHIRO-682 fix the potential threat when use "uri = uri + '/' " to bypassed shiro in 1.5, sorry

as the @JaynLau comment
under is @JaynLau report

Can not get the NamedFilterList when request uri is "/".

java.lang.IllegalArgumentException: There is no configured chain under the name/key [].
	at org.apache.shiro.web.filter.mgt.DefaultFilterChainManager.proxy(DefaultFilterChainManager.java:322) ~[shiro-web-1.5.0.jar:1.5.0]
	at org.apache.shiro.web.filter.mgt.PathMatchingFilterChainResolver.getChain(PathMatchingFilterChainResolver.java:126) ~[shiro-web-1.5.0.jar:1.5.0]
	at org.apache.shiro.web.servlet.AbstractShiroFilter.getExecutionChain(AbstractShiroFilter.java:415) ~[shiro-web-1.5.0.jar:1.5.0]
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:448) ~[shiro-web-1.5.0.jar:1.5.0]
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) ~[shiro-web-1.5.0.jar:1.5.0]
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) ~[shiro-core-1.5.0.jar:1.5.0]
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) ~[shiro-core-1.5.0.jar:1.5.0]
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387) ~[shiro-core-1.5.0.jar:1.5.0]
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) ~[shiro-web-1.5.0.jar:1.5.0]

The value of pathPattern is changed from "/" to "" , matching path definition / = user failed.
Because chainName is "/", not "".

this pr's solution is bypass substring when the request uri and pathPattern is /
please let me konw if any other better solution,
thanks @JaynLau ^~^

@fpapon
Copy link
Member

fpapon commented Feb 9, 2020

@tomsun28 thanks for the PR. We are releasing the 1.5.1 and we will merge this just after.

@fpapon fpapon self-requested a review February 9, 2020 07:10
Copy link
Member

@fpapon fpapon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
thanks!

@fpapon fpapon merged commit 9762f97 into apache:master Feb 13, 2020
@adessaigne
Copy link

Hello.
First, thank you very much for this fix.
I have a newbie question: would it be possible to include this commit in 1.5.1 release? I have to admit I'm not yet familiar with the release process. Thank you very much!

@coheigea
Copy link
Contributor

Yes, it will be in the 1.5.1 release.

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

Successfully merging this pull request may close these issues.

None yet

4 participants