5 Star 0 Fork 3

src-openEuler/xmlrpc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
xmlrpc-disallow-deserialization-of-ex-serializable-tags.patch 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
成子晗 提交于 2020-08-28 16:13 . package init
From 495d6136d9de5c0bbddadffe11b0841c6aafcb34 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Fri, 18 May 2018 15:22:49 +0200
Subject: [PATCH 1/2] Disallow deserialization of <ex:serializable> tags
Can be reenabled by setting JVM property
org.apache.xmlrpc.allowInsecureDeserialization to 1.
- Resolves CVE-2016-5003
---
.../java/org/apache/xmlrpc/parser/SerializableParser.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/common/src/main/java/org/apache/xmlrpc/parser/SerializableParser.java b/common/src/main/java/org/apache/xmlrpc/parser/SerializableParser.java
index 18f25ac..c8bb7ed 100644
--- a/common/src/main/java/org/apache/xmlrpc/parser/SerializableParser.java
+++ b/common/src/main/java/org/apache/xmlrpc/parser/SerializableParser.java
@@ -29,6 +29,14 @@ import org.apache.xmlrpc.XmlRpcException;
*/
public class SerializableParser extends ByteArrayParser {
public Object getResult() throws XmlRpcException {
+ if (!"1".equals(System.getProperty("org.apache.xmlrpc.allowInsecureDeserialization"))) {
+ throw new UnsupportedOperationException(
+ "Deserialization of ex:serializable objects is vulnerable to " +
+ "remote execution attacks and is disabled by default. " +
+ "If you are sure the source data is trusted, you can enable " +
+ "it by setting org.apache.xmlrpc.allowInsecureDeserialization " +
+ "JVM property to 1");
+ }
try {
byte[] res = (byte[]) super.getResult();
ByteArrayInputStream bais = new ByteArrayInputStream(res);
--
2.17.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/xmlrpc.git
git@gitee.com:src-openeuler/xmlrpc.git
src-openeuler
xmlrpc
xmlrpc
master

搜索帮助