Giter Site home page Giter Site logo

vulnplanet / l3x Goto Github PK

View Code? Open in Web Editor NEW
38.0 4.0 5.0 7.02 MB

AI-driven Static Analyzer. Supports Rust and Smart contracts: Solana based on Rust, Ethereum based on Solidity.

Home Page: https://vulnplanet.com/

HTML 44.57% Rust 55.43%
static-analyzer-for-rust static-analyzer-for-solana sast solana static-analysis ai gpt gpt-4 llm rust

l3x's People

Contributors

kajojify avatar yevh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

l3x's Issues

Failed to get a valid response from OpenAI

Use apikey can request success :

  -H "Authorization: Bearer $OPENAI_KEY" \
  -H "OpenAI-Organization: org-jzbvMiPRhVKpZWrIQ1JkhvOr"

But run error:
Error: Custom { kind: Other, error: "Failed to get a valid response from OpenAI" }

This is a public hazard

The program sends the entire source file for each regex match to GPT, which easily becomes extremely expensive. For example, a 1000 line Rust file can easily have 100 matches with normal usage, which'd lead to 100 000 lines of code sent, which can easily be a million tokens. GPT4 costs $10 / million tokens, so that's $10 to scan a fairly average file.

All of the integer overflow patterns can be particularly egregious and will make any mathy code rack up an extravagant bill.

Running this against rustc will produce 4600 matches just for the keyword unsafe. I don't even know how high the number of tokens sent goes here. Billions?

That's all without accounting for the fix suggestions GPT sends back. Those also cost a lot.

Don't run this, it will bankrupt you.


This rule is particularly fun, matching every &mut.

VulnerabilityCheck {
id: "RUST005".to_string(),
language: "Rust".to_string(),
title: "[Rust-General] Aliasing Rules Violation".to_string(),
severity: "Medium".to_string(),
pattern: r"&mut\s+\w+".to_string(),
safe_pattern: None,
description: "Mutable aliasing that could lead to data races or undefined behavior.".to_string(),
suggested_fix: "Ensure that mutable references do not alias by using exclusive access patterns.".to_string(),
},

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.