Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump bleach from 1.4.3 to 3.1.4 in /requirements #4

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Jun 5, 2020

Bumps bleach from 1.4.3 to 3.1.4.

Changelog

Sourced from bleach's changelog.

Version 3.1.4 (March 24th, 2020)

Security fixes

  • bleach.clean behavior parsing style attributes could result in a regular expression denial of service (ReDoS).

    Calls to bleach.clean with an allowed tag with an allowed style attribute were vulnerable to ReDoS. For example, bleach.clean(..., attributes={'a': ['style']}).

    This issue was confirmed in Bleach versions v3.1.3, v3.1.2, v3.1.1, v3.1.0, v3.0.0, v2.1.4, and v2.1.3. Earlier versions used a similar regular expression and should be considered vulnerable too.

    Anyone using Bleach <=v3.1.3 is encouraged to upgrade.

    https://bugzilla.mozilla.org/show_bug.cgi?id=1623633

Backwards incompatible changes

  • Style attributes with dashes, or single or double quoted values are cleaned instead of passed through.

Features

None

Bug fixes

None

Version 3.1.3 (March 17th, 2020)

Security fixes

None

Backwards incompatible changes

None

Features

  • Add relative link to code of conduct. (#442)

  • Drop deprecated 'setup.py test' support. (#507)

... (truncated)
Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Jun 5, 2020
@williamdes
Copy link
Member

williamdes commented Jun 6, 2020

https://github.com/mozilla/bleach/blob/master/CHANGES

A lot of breaking changes, the code needs to be reviewed and tested before upgrade

Our implementation:

from bleach import clean
def remove_html_markup(text, *args, **kwargs):
# removing reST's fucking field-list from our nice changelog item
text = re.sub(ur'<table class="docutils field-list".*?</table>', u'', text, flags=re.DOTALL | re.M)
def filter_div_attrs(name, value):
if name == 'style' and value == 'display: none':
return True
return False
text = clean(text,
tags=[u'table', 'colgroup', 'col', 'tr', 'td', 'th', 'tbody', 'thead',
u'a', u'abbr', u'acronym', u'b', u'blockquote',
u'code', u'em', u'i', u'li', u'ol', u'strong', u'ul', # these are default
u'dl', u'dt', u'dd', # allow definition lists
u'p', # we allow paragraphs cause they are fine
u'article', # эти теги добавляются github release даунлоадером
u'h1', u'h2', u'h3', u'h4', u'h5', # headers are ok too
u'del', u'strike', u's',
u'sup', u'small',
u'tt', # monospace
u'div', # dont see why it should be prohibited
u'span', # and spans too
u'pre', u'cite', u'samp', u'kbd',
u'str', # this is nonstandart, but used in Cloudera's docs
u'img', # images are nice
u'video', u'object', u'embed', u'param', # videos are ok too
u'br', # allow linebreaks because they are generated by VCS extractor.
],
attributes={u'a': [u'href', u'title'],
u'acronym': [u'title'],
u'img': [u'src', u'width', u'height', u'title'],
u'abbr': [u'title'],
u'sup': [u'id'],
u'video': [u'width', u'height', u'controls', u'src'],
u'object': [u'width', u'height', u'classid', u'codebase'],
u'embed': [u'width', u'height', u'type', u'src', u'flashvars'],
u'param': [u'name', u'value'],
u'div': filter_div_attrs},
styles=['display']) # NEVER ALLOW STYLE attribute without additional checking for style value
return text

@dependabot dependabot bot force-pushed the dependabot/pip/requirements/bleach-3.1.4 branch from c398589 to 9609669 Compare December 9, 2020 10:30
@dependabot dependabot bot force-pushed the dependabot/pip/requirements/bleach-3.1.4 branch from 9609669 to 512ee57 Compare December 9, 2020 10:32
@dependabot @github
Copy link
Author

dependabot bot commented on behalf of github Feb 2, 2021

Superseded by #14.

@dependabot dependabot bot closed this Feb 2, 2021
@dependabot dependabot bot deleted the dependabot/pip/requirements/bleach-3.1.4 branch February 2, 2021 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant