Skip to content

Commit

Permalink
fix: Json schema validation did not execute in specific cases
Browse files Browse the repository at this point in the history
  • Loading branch information
mattebit committed Dec 22, 2023
1 parent ef55407 commit 51aa03b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 5 additions & 4 deletions tool/src/main/java/migt/Check.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@

import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -401,6 +398,10 @@ private boolean execute_json() throws ParsingException {
found_obj instanceof java.lang.Integer) {
// the value is an double or integer, convert to string
found = String.valueOf(found_obj);
} else if (found_obj instanceof LinkedHashMap) {
found = new JSONObject((HashMap) found_obj).toString();
} else {
throw new RuntimeException("invalid object resulting from JWT Path");
}

} catch (com.jayway.jsonpath.PathNotFoundException e) {
Expand Down
3 changes: 1 addition & 2 deletions tool/src/main/java/migt/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import org.json.JSONObject;

import java.security.NoSuchAlgorithmException;

/**
* This class is the Parent class inherited by all modules. It provides some methods and parameters to be
* used by other classes
Expand Down Expand Up @@ -105,6 +103,7 @@ public boolean getResult() {

/**
* Execute this module and give a result
*
* @return the result of this module
*/
public void execute() {
Expand Down
3 changes: 1 addition & 2 deletions tool/src/main/java/migt/Operation.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package migt;

import burp.IInterceptedProxyMessage;
import org.checkerframework.checker.units.qual.A;
import org.json.JSONArray;
import org.json.JSONObject;

Expand Down Expand Up @@ -475,7 +474,7 @@ public void execute() {
at.loader(api);
at.execute();
setResult(at);
if (!applicable | ! result) {
if (!applicable | !result) {
return;
}
}
Expand Down

0 comments on commit 51aa03b

Please sign in to comment.