Removendo commons-text para usar solução nativa#78
Open
felipenedel wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
============================================
+ Coverage 89.39% 91.54% +2.15%
- Complexity 188 208 +20
============================================
Files 28 29 +1
Lines 330 414 +84
Branches 48 56 +8
============================================
+ Hits 295 379 +84
Misses 19 19
Partials 16 16 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivação
A lib
commons-textda Apache contém uma vulnerabilidade na versão1.9.0. É possível bumpar para a versão1.10.0, a qual corrige a CVE. Porém, ao analisar o uso da lib, percebi que apenas um método é utilizado:StringEscapeUtils.Além disso, por ser uma lib base, todas as dependências dela são transitivas para quem usa:
commons-lang3por exemplo traz dois jars (~800KB) transitivos para quem consome, para usar apenas um método.Então parti pra outra solução: internalizar o método e criar uma solução nativa de acordo com o padrão completo do HTML4. Foi criada uma tabela estática de dados com as 252 entidades do HTML 4.0. Foram criados inúmeros testes para checar o comportamento esperado.
Resultado esperado
validatione nopec;