File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
src/java/fr/paris/lutece/portal/web Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 4545import fr .paris .lutece .portal .web .constants .Messages ;
4646import fr .paris .lutece .portal .web .constants .Parameters ;
4747import fr .paris .lutece .util .html .HtmlTemplate ;
48+ import fr .paris .lutece .util .http .SecurityUtil ;
4849
4950import 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 ( ) )
Original file line number Diff line number Diff line change 4646import fr .paris .lutece .portal .service .util .AppPropertiesService ;
4747import fr .paris .lutece .portal .web .admin .AdminFeaturesPageJspBean ;
4848import fr .paris .lutece .util .html .HtmlTemplate ;
49+ import fr .paris .lutece .util .http .SecurityUtil ;
4950import fr .paris .lutece .util .stream .StreamUtil ;
5051
5152import java .io .File ;
@@ -209,7 +210,7 @@ public String getFileView( HttpServletRequest request )
209210 {
210211 String strFilePath = AppPathService .getWebAppPath ( );
211212
212- if ( strFilePath != null )
213+ if ( strFilePath != null && SecurityUtil . containsPathManipulationChars ( request , strFile ) )
213214 {
214215 strFileData = getFileData ( strFilePath + strDirectory + strFile );
215216 }
You can’t perform that action at this time.
0 commit comments