Skip to content

Commit 43d0ded

Browse files
committed
LUTECE-2210 : avoid path manipulation
1 parent 342ca3e commit 43d0ded

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/java/fr/paris/lutece/portal/web/style/ModesJspBean.java

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import fr.paris.lutece.portal.web.constants.Messages;
4646
import fr.paris.lutece.portal.web.constants.Parameters;
4747
import fr.paris.lutece.util.html.HtmlTemplate;
48+
import fr.paris.lutece.util.http.SecurityUtil;
4849

4950
import java.io.File;
5051

@@ -152,6 +153,11 @@ public String doCreateMode( HttpServletRequest request ) throws AccessDeniedExce
152153
strPath += File.separator;
153154
}
154155

156+
if ( SecurityUtil.containsPathManipulationChars(request, strPath) )
157+
{
158+
throw new AccessDeniedException( "Invalid path" );
159+
}
160+
155161
File dirPath = new File( AppPathService.getPath( PROPERTY_PATH_XSL ) + strPath );
156162

157163
if ( dirPath.exists( ) )

0 commit comments

Comments
 (0)