Skip to main content
QUICK REVIEW

[Paper Review] JSForce: A Forced Execution Engine for Malicious JavaScript Detection

Xunchao Hu, Yao Cheng|arXiv (Cornell University)|Jan 26, 2017
Advanced Malware Detection TechniquesComputer Science23 references6 citations
TL;DR

JSForce is a forced execution engine for JavaScript that enables complete code coverage and robust detection of malicious JavaScript without requiring inputs or environment setup. By using type inference and path exploration to tolerate runtime exceptions, it boosts malicious JavaScript detection by 206.29% with negligible false positive increase, significantly improving dynamic analysis effectiveness.

ABSTRACT

The drastic increase of JavaScript exploitation attacks has led to a strong interest in developing techniques to enable malicious JavaScript analysis. Existing analysis tech- niques fall into two general categories: static analysis and dynamic analysis. Static analysis tends to produce inaccurate results (both false positive and false negative) and is vulnerable to a wide series of obfuscation techniques. Thus, dynamic analysis is constantly gaining popularity for exposing the typical features of malicious JavaScript. However, existing dynamic analysis techniques possess limitations such as limited code coverage and incomplete environment setup, leaving a broad attack surface for evading the detection. To overcome these limitations, we present the design and implementation of a novel JavaScript forced execution engine named JSForce which drives an arbitrary JavaScript snippet to execute along different paths without any input or environment setup. We evaluate JSForce using 220,587 HTML and 23,509 PDF real- world samples. Experimental results show that by adopting our forced execution engine, the malicious JavaScript detection rate can be substantially boosted by 206.29% using same detection policy without any noticeable false positive increase. We also make JSForce publicly available as an online service and will release the source code to the security community upon the acceptance for publication.

Motivation & Objective

  • To address the limitations of existing dynamic analysis techniques, which suffer from limited code coverage and incomplete runtime environment setup in detecting malicious JavaScript.
  • To overcome the challenges of static analysis, which is vulnerable to obfuscation and produces high false positive and false negative rates.
  • To design a forced execution engine that drives arbitrary JavaScript snippets to execute along all feasible paths without requiring inputs or environment configuration.
  • To improve detection accuracy of existing dynamic analysis systems by enhancing code coverage and resilience to invalid object accesses.

Proposed method

  • JSForce is implemented on top of the V8 JavaScript engine to enable low-level control over execution and exception handling.
  • A type inference model is used to detect and recover from exceptions, allowing the engine to continue execution even when invalid object accesses occur.
  • Path exploration algorithms are designed to systematically traverse all feasible execution paths in JavaScript code, including those dependent on runtime conditions.
  • The engine forces branch outcomes by manipulating control flow and object states, enabling execution along paths that would otherwise be unreachable in standard execution.
  • It avoids reliance on predefined environment profiles or full-featured browsers/PDF readers, making it lightweight and portable.
  • The system is designed to be integrated into existing dynamic analysis pipelines without modifying their detection logic.

Experimental results

Research questions

  • RQ1Can a forced execution engine be built for JavaScript that achieves high code coverage without requiring input or environment setup?
  • RQ2How can runtime exceptions from invalid object accesses be handled to prevent premature termination during execution?
  • RQ3To what extent can forced execution improve the detection rate of malicious JavaScript in real-world HTML and PDF samples?
  • RQ4Can such a system be deployed as a standalone service with minimal performance overhead and negligible false positive increase?
  • RQ5How does forced execution compare to existing dynamic analysis techniques in terms of robustness and detection capability?

Key findings

  • JSForce improved the malicious JavaScript detection rate by 206.29% when used with the same detection policy, demonstrating a substantial boost in effectiveness.
  • The system achieved this improvement with no noticeable increase in false positives, maintaining detection reliability.
  • The performance overhead of JSForce was generally negligible, making it suitable for integration into real-world analysis pipelines.
  • The engine successfully executed JavaScript snippets across diverse environments, including embedded scripts in HTML and PDF files.
  • JSForce demonstrated resilience to invalid object accesses by using type inference to recover from exceptions and continue execution.
  • The evaluation on 220,587 HTML and 23,509 PDF samples confirmed the scalability and robustness of the approach in real-world scenarios.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.