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 45
45
import fr .paris .lutece .portal .web .constants .Messages ;
46
46
import fr .paris .lutece .portal .web .constants .Parameters ;
47
47
import fr .paris .lutece .util .html .HtmlTemplate ;
48
+ import fr .paris .lutece .util .http .SecurityUtil ;
48
49
49
50
import java .io .File ;
50
51
@@ -152,6 +153,11 @@ public String doCreateMode( HttpServletRequest request ) throws AccessDeniedExce
152
153
strPath += File .separator ;
153
154
}
154
155
156
+ if ( SecurityUtil .containsPathManipulationChars (request , strPath ) )
157
+ {
158
+ throw new AccessDeniedException ( "Invalid path" );
159
+ }
160
+
155
161
File dirPath = new File ( AppPathService .getPath ( PROPERTY_PATH_XSL ) + strPath );
156
162
157
163
if ( dirPath .exists ( ) )
Original file line number Diff line number Diff line change 46
46
import fr .paris .lutece .portal .service .util .AppPropertiesService ;
47
47
import fr .paris .lutece .portal .web .admin .AdminFeaturesPageJspBean ;
48
48
import fr .paris .lutece .util .html .HtmlTemplate ;
49
+ import fr .paris .lutece .util .http .SecurityUtil ;
49
50
import fr .paris .lutece .util .stream .StreamUtil ;
50
51
51
52
import java .io .File ;
@@ -209,7 +210,7 @@ public String getFileView( HttpServletRequest request )
209
210
{
210
211
String strFilePath = AppPathService .getWebAppPath ( );
211
212
212
- if ( strFilePath != null )
213
+ if ( strFilePath != null && SecurityUtil . containsPathManipulationChars ( request , strFile ) )
213
214
{
214
215
strFileData = getFileData ( strFilePath + strDirectory + strFile );
215
216
}
You can’t perform that action at this time.
0 commit comments