Menu

Hot-loading a regex word list from a website into a production API without getting ReDoS'd
📰

Hot-loading a regex word list from a website into a production API without getting ReDoS'd

DEV Community: security·Jordan Tate·7 days ago
#z1d0ws7s
#devtosecurity#devto#dev#pattern#file
Reading 0:00
15s threshold

By Jordan Tate, VP of Customer Relations at Conduyt.

We run a free message checker on our website. You paste a text message or an email draft, and it flags words that carriers and inbox providers tend to filter, with a reason and a safer swap for each one. The same engine sits inside our CRM's API, where it checks drafts before they go out.

The engine grades a draft against two word lists: one for email, one for SMS. Each entry is a regular expression plus a category, a level for each channel, a short explanation and a list of replacements. The lists change more often than the engine does. Our marketing side re-reads carrier and provider sources every week and updates the lists on the website.

For a while that meant two copies: the website's lists, and the copies bundled into the API, which only moved with a release. So we made the API read the website's lists directly. A word change on the website now reaches the API within the hour, with no release.

That raised the obvious question.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.