Skip to content

honatanpalma/JS-Vulnerability-ML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

JavaScript Vulnerability Detection using Machine Learning

Project Description

This project employs a Random Forest model trained on code features to predict potential vulnerabilities in JavaScript, providing a foundational understanding of machine learning applications in code security.

Dataset

Workflow

The KNIME workflow performs the following steps:

  1. Data Input: Reads the dataset.
  2. Preprocessing: Handles missing values and selects relevant features.
  3. Rule Engine: Creates a nominal column for stratified sampling.
  4. Partitioning: Splits the data into training and test sets using stratified sampling.
  5. Random Forest Learner: Trains a Random Forest model on the training data.
  6. Random Forest Predictor: Applies the model to the test data for predictions.
  7. Scorer: Evaluates the model's performance using metrics like accuracy, precision, recall, and F1-score.

How to Run

  • Download from KNIME Hub: The workflow can be downloaded directly from the KNIME Community Hub.
  • View on KNIME Hub: You can also visualize the workflow online at https://hub.knime.com/-/spaces/-/~wWHTgRJIGutbxkD-/current-state/
  • Local Execution:
    • Install KNIME: Download and install KNIME Analytics Platform from the official website at https://www.knime.com/downloads.
    • Import Workflow: Import the downloaded workflow file into your KNIME workspace.
    • Configure Data Input: Connect the "Data Input" node to your "JSVulnerabilityDataSet-1.0.csv" file.
    • Execute Workflow: Run the workflow to train the model and evaluate its performance.

Dependencies

  • KNIME Analytics Platform
  • KNIME Extension for Random Forest

License

This project is licensed under the MIT License.