Fixed: Server-Side Template Injection using Static (OFBIZ-11871)
Thanks to Alvaro's explanations, the problem was in MacroFormRenderer where, for lookups, we retrieve _LAST_VIEW_NAME_ as a parameter without encoding it. Thanks: Alvaro for advice Conflicts handled by hand in UtilHttp.java
This commit is contained in:
@@ -27,8 +27,10 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.FileNameMap;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
@@ -1012,6 +1014,15 @@ public final class UtilHttp {
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes a query parameter
|
||||
*
|
||||
* @throws UnsupportedEncodingException
|
||||
*/
|
||||
public static String getEncodedParameter(String parameter) throws UnsupportedEncodingException {
|
||||
return URLEncoder.encode(parameter, "UTF-8");
|
||||
}
|
||||
|
||||
public static String getRequestUriFromTarget(String target) {
|
||||
if (UtilValidate.isEmpty(target)) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user