You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rob Mercer <r....@magnushealth.com> on 2008/10/07 19:58:53 UTC

Welcome file bypasses security-constraint checking?

Hey all,

                Just noticed some odd behavior in tomcat today, one of
our admins setup a new folder on a context as follows:

 

/seasonpass/index.jsf

/seasonpass/index.jsp

 

He did not touch the web.xml file and yet the /seasonpass/ folder works
as expected!? Without altering the security-constraints in web.xml.

 

The idea is that index.jsp is our welcome file and would forward the
user automagically (a technical term) to the /index.jsf file in the
seasonpass folder if the user simply went to www.myurl.com/seasonpass/.
However, we have no mention of the /seasonpass/ directory in our "Not
Secured Pages" security-constraint elements... so I think what's
happening is the fact that our welcome-file is the index.jsp is
automatically allowed wherever it appears... Is this a security hole or
is this intended?

 

Relevant Copy from web.xml

 

<!-- Welcome files -->

      <welcome-file-list>

            <welcome-file>index.jsp</welcome-file>

      </welcome-file-list>

 

<security-constraint>

    <display-name>Not secured Pages</display-name>

    <web-resource-collection>

        <web-resource-name>Welcome pages</web-resource-name>

   <bunch of stuff not pertaining to the /seasonpass/ directory></blah>

   </web-resource-collection>

</security-constraint>

 

Rob

Web Developer/Site Administrator

 


RE: Welcome file bypasses security-constraint checking?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Rob Mercer [mailto:r.mercer@magnushealth.com]
> Subject: RE: Welcome file bypasses security-constraint checking?
>
> Tomcat 6.0.14

Thanks.

> <security-constraint>
>   <display-name>Not secured Pages</display-name>

[various unsecured declarations snipped]

> </security-constraint>
> <security-constraint>
>   <display-name>Restrict Secured JSF Pages</display-name>
>   <web-resource-collection>
>     <web-resource-name>JSF</web-resource-name>
>     <url-pattern>*.jsf</url-pattern>

The above should protect /seasonpass/index.jsf; does it?

>     <url-pattern>/index.jsp</url-pattern>

The above *does not* protect /seasonpass/index.jsp?  Did you expect it to?

>     <url-pattern>/servlet/*</url-pattern>

OT: you're not using the InvokerServlet, are you?  That would be abhorrent.

[protected methods snipped]

>   </web-resource-collection>

[other constraints snipped]

> </security-constraint>
> <security-constraint>
>   <display-name>Restrict Secured Servlets Pages</display-name>

[declarations snipped]

> </security-constraint>

More OT: the "Restrict Secured Servlets Pages" section is just a subset of "Restrict Secured JSF Pages", so you might as well just take it out.

I don't see anything in any of your constraints that would lead me to believe /seasonpass/index.jsp should be restricted.  Looks like Tomcat is behaving properly.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Welcome file bypasses security-constraint checking?

Posted by Rob Mercer <r....@magnushealth.com>.
Tomcat 6.0.14

<!-- Welcome files -->
	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>

	<!-- Security configuration -->
	<security-role>
		<role-name>tomcat</role-name>
	</security-role>

	<security-role>
		<role-name>USR</role-name>
	</security-role>

	<security-role>
		<role-name>MGR</role-name>
	</security-role>

	<security-role>
		<role-name>ORG</role-name>
	</security-role>
	
	<security-role>
		<role-name>ADM</role-name>
	</security-role>

	<security-constraint>
		<display-name>Not secured Pages</display-name>
		<web-resource-collection>
			<web-resource-name>Welcome
pages</web-resource-name>
			<url-pattern>/faqs.jsf</url-pattern>
			<url-pattern>/contact_us.jsf</url-pattern>
			<url-pattern>/contact_success.jsf</url-pattern>
			<url-pattern>/trouble.jsf</url-pattern>
			<url-pattern>/share.jsf</url-pattern>
			<url-pattern>/privacy-policy.jsf</url-pattern>
			<url-pattern>/forgot-password.jsf</url-pattern>
			<url-pattern>/demo/*</url-pattern>
			<url-pattern>/signup/welcome.jsf</url-pattern>
			<url-pattern>/signup/user-info.jsf</url-pattern>
			<url-pattern>/signup/terms.jsf</url-pattern>
	
<url-pattern>/signup/mgr/attending.jsf</url-pattern>
	
<url-pattern>/signup/mgr/gym-info.jsf</url-pattern>
			<url-pattern>/signup/mgr/terms.jsf</url-pattern>
	
<url-pattern>/signup/mgr/welcome.jsf</url-pattern>
			<url-pattern>/support.jsf</url-pattern>
	
<url-pattern>/password-reset-success.jsf</url-pattern>
	
<url-pattern>/signup/new-organization.jsf</url-pattern>
				<!--   notice the lack of /seasonpass/*
here   --->
		</web-resource-collection>
		<user-data-constraint> 
            <transport-guarantee>NONE</transport-guarantee>
        </user-data-constraint>	
	</security-constraint>

	<security-constraint>
		<display-name>Restrict Secured JSF Pages</display-name>
		<web-resource-collection>
			<web-resource-name>JSF</web-resource-name>
			<url-pattern>*.jsf</url-pattern>
			<url-pattern>/index.jsp</url-pattern>
			<url-pattern>/servlet/*</url-pattern>
			<http-method>DELETE</http-method>
			<http-method>GET</http-method>
			<http-method>HEAD</http-method>
			<http-method>OPTIONS</http-method>
			<http-method>POST</http-method>
			<http-method>PUT</http-method>
			<http-method>TRACE</http-method>
		</web-resource-collection>
		<auth-constraint>
			<role-name>tomcat</role-name>
			<role-name>USR</role-name>
			<role-name>MGR</role-name>
			<role-name>ORG</role-name>
			<role-name>ADM</role-name>
		</auth-constraint>
		<!--  require the user to access this page over a secure
link  -->
		<user-data-constraint> 
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
	</security-constraint>

	<security-constraint>
		<display-name>Restrict Secured Servlets
Pages</display-name>
		<web-resource-collection>
			<web-resource-name>Servlet</web-resource-name>
			<url-pattern>/servlet/*</url-pattern>
			<http-method>DELETE</http-method>
			<http-method>GET</http-method>
			<http-method>HEAD</http-method>
			<http-method>OPTIONS</http-method>
			<http-method>POST</http-method>
			<http-method>PUT</http-method>
			<http-method>TRACE</http-method>
		</web-resource-collection>
		<auth-constraint>
			<role-name>tomcat</role-name>
			<role-name>USR</role-name>
			<role-name>MGR</role-name>
			<role-name>ORG</role-name>
			<role-name>ADM</role-name>
		</auth-constraint>
		<!--  require the user to access this page over a secure
link  -->
		<user-data-constraint> 
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
		
	</security-constraint>
	
-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Tuesday, October 07, 2008 2:47 PM
To: Tomcat Users List
Subject: RE: Welcome file bypasses security-constraint checking?

> From: Rob Mercer [mailto:r.mercer@magnushealth.com]
> Subject: Welcome file bypasses security-constraint checking?
>
> Just noticed some odd behavior in tomcat today

Care to tell us the version, or should we consult a psychic reader?


> He did not touch the web.xml file and yet the /seasonpass/
> folder works as expected!?

Since security constraints usually define what is restricted, not what
is public, that's not surprising.

> Relevant Copy from web.xml

Without the actual config statements, it's not that relevant...

> <security-constraint>
>     <display-name>Not secured Pages</display-name>
>     <web-resource-collection>
>         <web-resource-name>Welcome pages</web-resource-name>
>    <bunch of stuff not pertaining to the /seasonpass/
> directory></blah>
>    </web-resource-collection>
> </security-constraint>

I suppose we should guess the contents of your <security-constraint> as
well...

Please post the actual web.xml file, along with your Tomcat version.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Welcome file bypasses security-constraint checking?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Rob Mercer [mailto:r.mercer@magnushealth.com]
> Subject: Welcome file bypasses security-constraint checking?
>
> Just noticed some odd behavior in tomcat today

Care to tell us the version, or should we consult a psychic reader?


> He did not touch the web.xml file and yet the /seasonpass/
> folder works as expected!?

Since security constraints usually define what is restricted, not what is public, that's not surprising.

> Relevant Copy from web.xml

Without the actual config statements, it's not that relevant...

> <security-constraint>
>     <display-name>Not secured Pages</display-name>
>     <web-resource-collection>
>         <web-resource-name>Welcome pages</web-resource-name>
>    <bunch of stuff not pertaining to the /seasonpass/
> directory></blah>
>    </web-resource-collection>
> </security-constraint>

I suppose we should guess the contents of your <security-constraint> as well...

Please post the actual web.xml file, along with your Tomcat version.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org