Skip to content

Commit 07caac7

Browse files
author
‘niuerzhuang’
committed
fix: Custom model field adds ignore conditions: field.isSynthetic(),field.isEnumConstant(),obj instanceof Enumeration
1 parent 924bdf9 commit 07caac7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dongtai-core/src/main/java/io/dongtai/iast/core/utils/TaintPoolUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public static boolean isAllowTaintType(Class<?> objType) {
131131
}
132132

133133
public static boolean isAllowTaintType(Object obj) {
134-
if (obj == null || obj instanceof Enumeration) {
134+
if (obj == null) {
135135
return false;
136136
}
137137
return isAllowTaintType(obj.getClass());
@@ -210,7 +210,7 @@ private static void customModel(Boolean isMicroservice, Object obj, Class<?> cls
210210
try {
211211
Field[] declaredFields = ReflectUtils.getDeclaredFieldsSecurity(cls);
212212
for (Field field : declaredFields) {
213-
if (!Modifier.isStatic(field.getModifiers()) && !field.isSynthetic() && !field.isEnumConstant()) {
213+
if (!Modifier.isStatic(field.getModifiers()) && !field.isSynthetic() && !field.isEnumConstant() && !(field.get(obj) instanceof Enumeration)) {
214214
trackObject(event, policyNode, field.get(obj), depth + 1, isMicroservice);
215215
}
216216
}

0 commit comments

Comments
 (0)