-
Notifications
You must be signed in to change notification settings - Fork 6k
SEC-1893: Default https 8443 port mappings redirection #2120
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
Comments
Rob Winch said: I'm not able to reproduce this issue in Spring Security 3.1. I do not think the default constructor is a problem because |
Luke Woodward said: I have been able to reproduce this issue, using Spring Security 3.1.0.RELEASE and Apache Tomcat 6.0.35 on Windows 7 x64. I installed Tomcat using the Windows .msi installer, and the only change I've made to its configuration is the change to conf/server.xml described below. I've attached to this issue a small web application that I used to reproduce this issue. This web application has a single login-protected page, and if you get to the login page, the credentials test/test should let you log in. To reproduce the issue: Extract the attached zip file TestSecureApp.zip somewhere.Edit the extracted build.xml file and set the value of the property
|
Rob Winch said: The problem is that the PortResolver in the LoginUrlAuthenticationEntryPoint uses a PortMapper that is not configured by the namespace (AuthenticationConfigBuilder). This would only impact instances where the http port is using a common https port or vice versa. In the meantime, you can configure the LoginUrlAuthenticationEntryPoint explicitly. Something like the following should work:
PS: Any reason the attached example application maps the http port 8080 to https port 8080? |
Luke Woodward said: The application I submitted runs entirely in HTTPS - there's no HTTP part, and so (as far as I understand) there isn't really any need for HTTP to HTTPS port mappings. The one mapping I provided was a dummy mapping: I would have used an empty set of port-mappings if I could, but that doesn't validate against the schema. |
Rob Winch said: In reply to comment #4:
Ok so this was just an attempt to work around the bug then. I ask because it can be useful to know what others are doing and why they are doing it. |
Rob Winch said: I have pushed a fix into master. |
Luke Woodward said: I've now tested the fix (sorry for the delay in doing so) and I can confirm that it works. Thanks. |
Is there an example demonstrating how to |
Alexander Sedelnikov (Migrated from SEC-1893) said:
Port-mappings does not work properly,
when it setup in spring xml configuration such as:
ss:port-mappings
<ss:port-mapping http="8181" https="8080"/>
/ss:port-mappings
with:
<ss:form-login login-page="/access/login.html"
username-parameter="username"
password-parameter="password"
login-processing-url="/app/loginuser"
default-target-url="/app/" />
Spring security redirected me to url (https://localhost:8443/access/login.html must be https://localhost:8080/access/login.html) with 8443 port (by default in the org/springframework/security/web/PortMapperImpl.java) when I try to access protected page.
I edited PortMapperImpl.java:
and redirection is working now to 8080 https.
I think that when ss:port-mappings.../ss:port-mappings setted,
PortMapperImpl.java:
private final Map<Integer, Integer> httpsPortMappings;
"httpsPortMappings" not cleaned properly, and previously key value are available.
The text was updated successfully, but these errors were encountered: