bgalek / safe-svg

Simple and lightweight library that helps to validate SVG files in security manners.

Home Page:https://detektywi.it/2019/03/bezpieczny-svg/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Default whitelist is invalidated with recent improvement

kiziltas opened this issue · comments

commented

I think with this change 12f3b33 the default whitelist is invalidated and now the only style that is allowed is "enable-background". The allowStyling() method should have kept and extended with specific styles (because allowStyling() method unifies everything that's sent).

.allowStyling()
.allowStyling(CssSchema.withProperties(SVG_SPECIFIC_STYLES))

Bonus: It would be awesome if we could set a custom whitelist when composing SvgSecurityValidator :)

Hi kiziltas!
I'll look at it ;) Of course, your'e welcom to create a PR :)

@kiziltas could you provide an svg file example? :)

@kiziltas You were right, version 1.1.1 is broken, I'm fixing the issue right away! I'll add some more tests to cover this case.

commented

Thanks! (and apologize I missed your early input requests)

no problem! :)