Giter Site home page Giter Site logo

vulnplanet / l3x Goto Github PK

View Code? Open in Web Editor NEW
39.0 39.0 6.0 7.06 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.69% Rust 55.31%
ai ethereum ethereum-contract gpt gpt-4 llm rust rust-security sast sast-rust smart-contracts smart-contracts-audit smart-contracts-security solana solana-audit solidity solidity-contracts static-analysis static-analyzer-for-rust static-analyzer-for-solana

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(),
},

Failed to get a valid response from OpenAI

          Hey there! Sorry for a long response.

Fixed it in the latest commit. Now you can set up openai org and project via the corresponding env variables: OPENAI_ORG_ID and OPENAI_ORG_ID.

Originally posted by @kajojify in #5 (comment)

I'm set OPENAI_API_KEY,OPENAI_ORG_ID and OPENAI_PROJECT_ID , but still can't run l3x.
Use curl to request openapi can success.

image

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.