saferegex

saferegex is a tool for testing regular expressions for ReDoS vulnerabilities.

Лицензия

Лицензия

MIT
Группа

Группа

com.github.jkutner
Идентификатор

Идентификатор

saferegex
Последняя версия

Последняя версия

1.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

saferegex
saferegex is a tool for testing regular expressions for ReDoS vulnerabilities.
Ссылка на сайт

Ссылка на сайт

https://github.com/jkutner/saferegex
Система контроля версий

Система контроля версий

https://github.com/jkutner/saferegex

Скачать saferegex

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.jkutner/saferegex/ -->
<dependency>
    <groupId>com.github.jkutner</groupId>
    <artifactId>saferegex</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.jkutner/saferegex/
implementation 'com.github.jkutner:saferegex:1.0.2'
// https://jarcasting.com/artifacts/com.github.jkutner/saferegex/
implementation ("com.github.jkutner:saferegex:1.0.2")
'com.github.jkutner:saferegex:jar:1.0.2'
<dependency org="com.github.jkutner" name="saferegex" rev="1.0.2">
  <artifact name="saferegex" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.jkutner', module='saferegex', version='1.0.2')
)
libraryDependencies += "com.github.jkutner" % "saferegex" % "1.0.2"
[com.github.jkutner/saferegex "1.0.2"]

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

SafeRegex Build Status Maven Central

SafeRegex is a tool that tests regular expressions for ReDoS vulnerabilities. In contrast to similar tools, SafeRegex doesn't use plain fuzzing to detect vulnerabilites but uses an approach similar to model checking. This makes it much more effective than plain fuzzers.

Usage

Build the executable JAR:

$ ./mvnw clean package

Run the JAR against an evil regex:

$ java -jar target/saferegex.jar "(a|aa)+"

Testing: (a|aa)+
More than 10000 samples found.
***
This expression is vulnerable.
Sample input: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab

Or a safe regex:

$ java -jar target/saferegex.jar "(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.a-zA-Z_]*[0-9a-zA-Z])*(:(0-9)*)?(\/?)([a-zA-Z0-9\-\.\?\,\:\'\/\\\+=&amp;%\$#_]*)?"

Testing: (ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.a-zA-Z_]*[0-9a-zA-Z])*(:(0-9)*)?(\/?)([a-zA-Z0-9\-\.\?\,\:\'\/\\\+=&amp;%\$#_]*)?
More than 10000 samples found.
************************************************************************************************************************************************************************************************************
*****************************************************************************************************************************
Tests: 3297
Broken samples: 0
This expression is probably not vulnerable for sample sizes < 10000

Usage as a dependency

<dependency>
    <groupId>com.github.jkutner</groupId>
    <artifactId>saferegex</artifactId>
</dependency>

History

The project was created on Feb 16, 2011 by Sebastian Kübeck and hosted on Google Code. This project has been forked from the original and now maintained by Joe Kutner.

License

Apache License, Version 2.0

Версии библиотеки

Версия
1.0.2
1.0.0