facebook / facebook/duckling

Time interval data causing hang (potential regex dos vulnerability)

Aberta
#338 5 comentários 5 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Haskell
Estrelas
4.3k
Forks
740
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

While running duckling over a large set of data, I ran across a particular example that caused it to hang reproducibly. Trying to extract `time` from the following text:
```
from 10.00am on Friday 15th April 2016 until 10.00am on Tuesday 19th April 2016
```

This example does not cause a crash or traceback, it just causes an infinite hang until the thread is killed. My best guess is
- a regex dos caused by a badly written pattern
- a recursive call function call

Both clauses (`from` and `until`) need to be present, neither is sufficient to cause a crash on its own. Removing trivial parts of the text allows the function call to return:

```
# empty response (thread killed)
"from 10.00am on Friday 15th April 2016 until 10.00am on Tuesday 19th April 2016"
# very slow
"from 10.00am Friday 15 April 2016 until 10.00am Tuesday 19 April 2016"
# works
"from 10.00am Friday 15 April until 10.00am Tuesday 19 April"
```

---

See #339 for a branch reproducing this case.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.