Questions tagged [regex]

security concerns around regular expressions; using them as security-critical filters, processing user-supplied regexes, vulnerabilities in regex parsers, etc.

Filter by
Sorted by
Tagged with
0 votes
0 answers
5 views

How to reduce font size for all images, dates and times in Microsoft MHT document? [migrated]

How to easily, non-programming, non-third-party way to reduce size of all: dates and time Images Headers Doing so helps those read essential information within MHT document from Steps Recorder. As ...
panes-rubrics's user avatar
0 votes
0 answers
13 views

Is VBScript RegExp object exploitable with a code injection or does it escape special characters?

The VBScript's RegExp object used in Classic ASP allows one to set a pattern then execute it. If a user provides the search string, is it exploitable for IDS08-J / CWE-625 (Permissive Regex)? Or ...
Paradox's user avatar
  • 188
0 votes
0 answers
78 views

Can I use pcres in Suricata for UDP traffic?

I have a pattern that goes like this: Starts with |00|, is followed by a variable number of ASCII characters in uppercase that can have at most length 22, followed by 12 |00| bytes, followed by 6 ...
CBot's user avatar
  • 33
0 votes
0 answers
112 views

Bypass XSS filter in data- attribute

My web application allows users to make custom divs with whitelisted attributes. One of them is data-{user-input}. Recently I have seen the following XSS payload: [[div data-test/onmouseover=alert(1)]]...
The Modern Gamer's user avatar
0 votes
0 answers
167 views

Stopping a Subscription Bomb

Are there any methods for stopping a subscription bomb other than issuing a new email address? Creating gmail filters is only getting us so far as there are more emails coming in than we can keep up ...
dzzl's user avatar
  • 11
2 votes
2 answers
3k views

How do I bypass a regex filter that filters all html to avoid xss?

How do I bypass a regex filter that filters all html to avoid xss? I've tried using things like <img src="aa" onerror="alert(1)"> but still no luck. This is for a CTF ...
ctfhard's user avatar
  • 21
0 votes
2 answers
1k views

Is it possible to exploit preg_match similar to preg_replace PHP? [closed]

I'm currently working on a website and want to prevent characters being inputted, i am using following code if (!preg_match("/^[a-zA-Z0-9_!,()& -\/]*$/" is it possible to exploit this ...
Anon's user avatar
  • 1
1 vote
3 answers
596 views

Mailcleaner - Fail2ban - mc-exim-filter configuration

I'm using Fail2ban on a Mailcleaner server which works pretty good, but I want to update it to ban hosts who want to spoof our addresses. I'm using the "original" mc-exim-filter, but I don't ...
Krisztian's user avatar
3 votes
1 answer
552 views

Email pattern ReDoS

I would like to verify that the input from the user complies to the format of email address (in Java application). On the following page there is verbose regex that should properly validate the email ...
RenatoIvancic's user avatar
-1 votes
1 answer
2k views

Source of RegEx examples of Secret Detection patterns in repositories?

Where can I find RegEx that can pattern match common secret strings? I have a product that scans repos and commits and in case a developer tries to commit a secret (i.e. passwords, keys). It scans for ...
QuantenGhost's user avatar
1 vote
1 answer
725 views

Possible to bypass this regex for XSS?

When testing for XSS, is it at all possible to bypass the below regex? I doubt it because it only accepts uppercase and lowercase letters, but maybe? /^[A-Za-z]+$/
Jordan Baron's user avatar
0 votes
0 answers
79 views

Is it safe to pass user input through rails gsub?

Are there risks associated with using gsub on user input? Can it be used for regular expression DoS?
Tim Abell's user avatar
  • 101
1 vote
0 answers
205 views

Regex DoS: Is OWASP's characterization of "evil regexes" complete?

OWASP defines "evil regex" (here) as follows: Evil Regexes A Regex is called "evil" if it can stuck on crafted input. Evil Regex pattern contains: Grouping with repetition ...
Shuzheng's user avatar
  • 1,177
0 votes
1 answer
204 views

What is the following regex trying to protect against?

I am looking at a Java web application that compares all incoming request params and cookies against the following regex. If it matches, it is considered "an attack" and refuses the request. I'm ...
secondbreakfast's user avatar
1 vote
0 answers
2k views

OAuth access token/API key patterns for large web sites

First off, let me preface this post by saying I'm not a security expert. I'm trying to build regular expressions to find OAuth 2.0 access tokens and API Keys for common web sites such as Google, ...
Geoff Williams's user avatar
0 votes
0 answers
669 views

What is the risk of allowing user input in Python's 're' module

Some context I'm currently building an application which lets user's set up dynamic, queries they can execute later. A great addition to this seems like a regex module, in which users can filter ...
Paradoxis's user avatar
  • 882
0 votes
0 answers
3k views

Boolean blind SQLi with sqlmap

I am trying to run sqlmap in order to find a flag for a CTF. The injection string is sent via a POST request in the parameter called search. The response is received as either 1, 2, or 3 (error codes),...
user209814's user avatar
2 votes
0 answers
234 views

Can a Regex without characters [(+*{}? be dangerous?

I want to create some functionality for non dangerous regex. I want to accept only very few regex cases where it is safe to assume that they are not malicious (but still giving the user some ...
Fabian Enrique Gutierrez's user avatar
0 votes
1 answer
81 views

How to filter HTML Event in Native PHP7

i want to creating xss filter for my own project, this is for html event filtering preg_replace("/ on\w+='[^']*'/i", '', preg_replace('/ on\w+="[^"]*"/i', '', $framed)); but considering to more ...
Reyhan Fabiano's user avatar
1 vote
1 answer
392 views

Is this regular expression vulnerable to DoS?

FindBugs flagged the following email address validation regex as vulnerable to DoS: ^[\w!#$%&'*+/=?`{|}~^-]+(?:\.[\w!#$%&'*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,6}$ Here's an easier ...
Duncan Jones's user avatar
  • 1,647
43 votes
7 answers
37k views

Is it possible to detect 100% of SQLi with a simple regex?

I'm wondering if it is possible to detect 100% of the possible SQLi attacks using a simple regex. In other words, using very simple PHP code as an example: if (preg_match("/select/i", $input)) { ...
reed's user avatar
  • 15.6k
1 vote
2 answers
2k views

What are the common features to identify Brute-Force attack from Apache log file?

There are various methods to find attack patterns for different types of attacks. Apache-scalp is one such tool, but the rule set is not available to find the brute-force attack pattern via regular ...
Uday's user avatar
  • 11
1 vote
1 answer
169 views

Alternative forms for special characters in terminal

I was solving a problem on a popular hacking for fun website, when I got following idea: Is it possible to represent - for example a '/' (just the slash) in the terminal (linux) in another way - for ...
OcK's user avatar
  • 13
97 votes
6 answers
20k views

Is it safe to let a user type a regex as a search input?

I was in a mall a few days ago and I searched for a shop on an indication panel. Out of curiosity, I tried a search with (.+) and was a bit surprised to get the list of all the shops in the mall. I'...
Xavier59's user avatar
  • 2,884
2 votes
0 answers
2k views

Brute force hex password with exactly two special characters using JohnTheRipper

I want to optimize the way I'm using John the Ripper. I have a password with a know length (9) that consists only of (lower-case) hex characters and exactly two special characters. First I tried ...
Norbert's user avatar
  • 121