Coder Social home page Coder Social logo

universe's People

Contributors

colinwm avatar colin353 avatar colin-merkel avatar

Stargazers

Cora Sutton avatar Nathan Hollis avatar Sai Adarsh S avatar Shadab Zafar avatar Aneurin Cariadwyn avatar Simon Elsbrock avatar arpu avatar Jared Rand avatar  avatar Martin Lai avatar  avatar  avatar Gaurav Kanoongo avatar Pegleg avatar mario avatar Dustin avatar Doug Tolton avatar Andrew Banchich avatar Rudy Ges avatar Nikita avatar

Watchers

 avatar

universe's Issues

Potential ReDoS Vulnerability or Inefficient Regular Expression in Project: Need for Assessment and Mitigation

Hello,

I am writing to report a potential Regular Expression Denial of Service (ReDoS) vulnerability or Inefficient Regular Expression in the project. This issue arises when specially crafted input strings are used in the context of distributed, high-volume requests, potentially leading to a denial-of-service attack.

Location of Issue:

The vulnerability is related to a regular expression used in the following validation file, which may result in significantly prolonged execution times under certain conditions.

{ regex::Regex::new(r"\s*impl(<.*?>)?\s+(\w+)(<.*?>)?(\s+for\s+(\w+))?").unwrap() };

PoC Files and Comparisons:

PoC.zip

To evaluate the performance of this inefficient regular expression matching with varying input contents, the following commands can be executed within the PoC folder:

cargo build --release # Build the PoC executable file
time ./target/release/redos AttackString10MB.txt
time ./target/release/redos RandomString10MB.txt
time ./target/release/redos AttackString1MB.txt
time ./target/release/redos RandomString1MB.txt

These commands measure the time taken for the regular expression to match different types of strings. The results on my machine are as follows: For a 10MB attack string, the processing time took 413.95 seconds. In contrast, a 10MB random string took only 0.016 seconds. A 1MB attack string took 3.259 seconds. By comparison, a 1MB random string took merely 0.005 seconds.

Proposed Solution:

A possible mitigation strategy could include limiting the input length to prevent excessive processing times.

Additional Considerations:

Historically, it was believed that using regex engines with non-backtracking implementations (such as those in Rust or Go) would not lead to ReDoS vulnerabilities. However, recent studies have shown that this is not always the case. I recommend an assessment of how this issue might impact this project.

Thank you for your attention to this matter. Your evaluation and response to this potential security concern would be greatly appreciated.

Best regards,

search as cargo workspace and cargo crates with Cargo.toml files in keeping with rust build lifestyle

If you made tools search available without requiring docker/bazel & friends,
I believe your work would be more reusable and more popular.

Please consider offering it as a cargo workspace with a number of cargo projects within managed by a Cargo.toml.
Please consider its different reusable subcomponents as different crates as managed by different Cargo.toml files.

This is in keeping with the usual rust build lifestyle where everything usually is built with cargo and its associated Cargo.toml.

Thank you for listening.

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.