Git Product home page Git Product logo

devign's Introduction

Devign - Implementation

In this repository, we provide lightweight implementation of Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networks.

Requirements

  1. Python=3.6
  2. Pytorch==1.4.0
  3. Deep Graph Library

Usage

python main.py \
      --dataset <name_of_the_dataset> \
      --input_dir <directory_of_the_input>;

Datset

The input_dir should contain three json files namely

  1. train_GGNNinput.json
  2. valid_GGNNinput.json
  3. test_GGNNinput.json

Each json file should contain a list of json object of the following structure

{
  'node_features': <A list of features representing every nodes in the graph>,
  'graph': <A list of edges>
  'target': <0 or 1 representing the vulnerability>
}
  • Let's assume n nodes in the graph are indexed as 0 to n-1. The length of node_features list should be n. Each feature vector should be 100 elements long. Thus the node_features list should be a 2D list of shape (n, 100).

  • The length of graph list should be the number of the edges. Each edge should be represented as a three element tuple [source, edge_type, destination]. Where the source and destinations are indices of corresponding node in node_features list. Edge types should be from 0 to max_edge_types.

Note

  1. In this implementation, we followed Devign's paper. We could NOT recreate the result in the original paper though.

Reference

[1] Zhou, Yaqin, et al. "Devign: Effective vulnerability identification by learning comprehensive program semantics via graph neural networks." arXiv preprint arXiv:1909.03496 (2019).

devign's People

Contributors

saikat107 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.