Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic analysis pitfalls to address #7

Open
1 task
Col-E opened this issue Jul 12, 2023 · 1 comment
Open
1 task

Dynamic analysis pitfalls to address #7

Col-E opened this issue Jul 12, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Col-E
Copy link
Collaborator

Col-E commented Jul 12, 2023

In our dynamic model, the plan is to force visitation of as many control paths as possible. This maximizes the amount of content we can match against, but may introduce some additional issues we'll have to address.

Each of these should have test cases written for them, with demonstrations on configuring Concoction to circumvent the issues.

Infinite loops in dead code blocks

A simple example:

if (true) { 
    // real application code
} else {
    while (true) { ... } // fake control flow path
}

Sneaky manipulation of values

Ideally, most of these are supported by SSVM out of the box given how specific it is at reimplementing JVM features.

  • Changing String.value via reflection
    • Straight-forward reflection
    • Via sun.reflect.ConstantPool and abusing constant interning

Abusing slow methods to delay execution beyond a set threshold

Example code:

// stupid delay mechanism that runs after a 'reasonable' amount of time on a host machine, but slower when all steps are interpreted in our VM
for (int i = Integer.MIN_VALUE; i < Integer.MAX_VALUE; i++){ 
  double unused = Math.sqrt(i) * (i - 1) / (i - 0.5) + 432 * i; // replace with slow math operation
}
// malicious code here

Ideally, we can define intrinsic implementations for most common things, even if they don't technically need to be implemented. For instance, the Math utils can be fully run with SSVM without any intrinsic handling. But defining handlers for them would speed things up and be a benefit on multiple fronts.

@Col-E Col-E added the enhancement New feature or request label Jul 12, 2023
@Col-E
Copy link
Collaborator Author

Col-E commented Sep 7, 2023

Infinite loops can be addressed with: xxDark/SSVM@4030675

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant