diff --git a/linkis-public-enhancements/linkis-udf-service/src/main/java/org/apache/linkis/udf/api/UDFRestfulApi.java b/linkis-public-enhancements/linkis-udf-service/src/main/java/org/apache/linkis/udf/api/UDFRestfulApi.java index fa1841239b..f806786a67 100644 --- a/linkis-public-enhancements/linkis-udf-service/src/main/java/org/apache/linkis/udf/api/UDFRestfulApi.java +++ b/linkis-public-enhancements/linkis-udf-service/src/main/java/org/apache/linkis/udf/api/UDFRestfulApi.java @@ -1447,8 +1447,8 @@ public Message pythonUpload( @RequestMapping(path = "/get-register-functions", method = RequestMethod.GET) public Message getRegisterFunctions(HttpServletRequest req, @RequestParam("path") String path) throws IOException { - // 使用正则校验path,防止命令注入漏洞 - if (!path.matches("^[a-zA-Z0-9_.-/:]+$")) { + String pathPrefix = "file:///"; + if (StringUtils.isEmpty(path) || !path.startsWith(pathPrefix)) { return Message.error("path参数格式错误"); } if (StringUtils.endsWithIgnoreCase(path, Constants.FILE_EXTENSION_PY) diff --git a/linkis-web/src/apps/URM/module/functionManagement/addFunctionModal.vue b/linkis-web/src/apps/URM/module/functionManagement/addFunctionModal.vue index 51c2b64604..a12a1abac2 100644 --- a/linkis-web/src/apps/URM/module/functionManagement/addFunctionModal.vue +++ b/linkis-web/src/apps/URM/module/functionManagement/addFunctionModal.vue @@ -5,9 +5,9 @@ ~ The ASF licenses this file to You under the Apache License, Version 2.0 ~ (the "License"); you may not use this file except in compliance with ~ the License. You may obtain a copy of the License at - ~ + ~ ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ + ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -215,10 +215,10 @@ type="textarea"/> - -