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

[Security] Bump flask from 0.10.1 to 1.0 #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dependabot-preview[bot]
Copy link

Bumps flask from 0.10.1 to 1.0. This update includes security fixes.

Vulnerabilities fixed

Sourced from The GitHub Security Advisory Database.

Low severity vulnerability that affects flask The Pallets Project Flask before 1.0 is affected by: unexpected memory usage. The impact is: denial of service. The attack vector is: crafted encoded JSON data. The fixed version is: 1.

Affected versions: < 1.0.0

Sourced from The GitHub Security Advisory Database.

Moderate severity vulnerability that affects flask The Pallets Project flask version Before 0.12.3 contains a CWE-20: Improper Input Validation vulnerability in flask that can result in Large amount of memory usage possibly leading to denial of service. This attack appear to be exploitable via Attacker provides JSON data in incorrect encoding. This vulnerability appears to have been fixed in 0.12.3.

Affected versions: < 0.12.3

Release notes

Sourced from flask's releases.

1.0

The Pallets team is pleased to release Flask 1.0. [Read the announcement on our blog.](https://www.palletsprojects.com/blog/flask-1-0-released/

There are over a year's worth of changes in this release. Many features have been improved or changed. Read the changelog to understand how your project's code will be affected.

JSON Security Fix

Flask previously decoded incoming JSON bytes using the content type of the request. Although JSON should only be encoded as UTF-8, Flask was more lenient. However, Python includes non-text related encodings that could result in unexpected memory use by a request.

Flask will now detect the encoding of incoming JSON data as one of the supported UTF encodings, and will not allow arbitrary encodings from the request.

Install or Upgrade

Install from PyPI with pip:

pip install -U Flask

0.12.4

This is a repackage of 0.12.3 to fix an issue with how the package was built.

Upgrade

Upgrade from PyPI with pip. Use a version identifier if you want to stay at 0.12:

pip install -U 'Flask~=0.12.4'

0.12.3

This release includes an important security fix for JSON and a minor backport for CLI support in PyCharm. It is provided for projects that cannot update to Flask 1.0 immediately. See the 1.0 announcement and update to it instead if possible.

JSON Security Fix

Flask previously decoded incoming JSON bytes using the content type of the request. Although JSON should only be encoded as UTF-8, Flask was more lenient. However, Python includes non-text related encodings that could result in unexpected memory use by a request.

Flask will now detect the encoding of incoming JSON data as one of the supported UTF encodings, and will not allow arbitrary encodings from the request.

Upgrade

Upgrade from PyPI with pip. Use a version identifier if you want to stay at 0.12:

pip install -U 'Flask~=0.12.3'
... (truncated)
Changelog

Sourced from flask's changelog.

Version 1.0

Released 2018-04-26

  • Python 2.6 and 3.3 are no longer supported.
  • Bump minimum dependency versions to the latest stable versions: Werkzeug >= 0.14, Jinja >= 2.10, itsdangerous >= 0.24, Click >= 5.1. 2586
  • Skip app.run <Flask.run> when a Flask application is run from the command line. This avoids some behavior that was confusing to debug.
  • Change the default for JSONIFY_PRETTYPRINT_REGULAR to False. ~json.jsonify returns a compact format by default, and an indented format in debug mode. 2193
  • Flask.__init__ <Flask> accepts the host_matching argument and sets it on ~Flask.url_map. 1559
  • Flask.__init__ <Flask> accepts the static_host argument and passes it as the host argument when defining the static route. 1559
  • send_file supports Unicode in attachment_filename. 2223
  • Pass _scheme argument from url_for to ~Flask.handle_url_build_error. 2017
  • ~Flask.add_url_rule accepts the provide_automatic_options argument to disable adding the OPTIONS method. 1489
  • ~views.MethodView subclasses inherit method handlers from base classes. 1936
  • Errors caused while opening the session at the beginning of the request are handled by the app's error handlers. 2254
  • Blueprints gained ~Blueprint.json_encoder and ~Blueprint.json_decoder attributes to override the app's encoder and decoder. 1898
  • Flask.make_response raises TypeError instead of ValueError for bad response types. The error messages have been improved to describe why the type is invalid. 2256
  • Add routes CLI command to output routes registered on the application. 2259
  • Show warning when session cookie domain is a bare hostname or an IP address, as these may not behave properly in some browsers, such as Chrome. 2282
  • Allow IP address as exact session cookie domain. 2282
  • SESSION_COOKIE_DOMAIN is set if it is detected through SERVER_NAME. 2282
  • Auto-detect zero-argument app factory called create_app or make_app from FLASK_APP. 2297
  • Factory functions are not required to take a script_info parameter to work with the flask command. If they take a single parameter or a parameter named script_info, the ~cli.ScriptInfo object will be passed. 2319
  • FLASK_APP can be set to an app factory, with arguments if needed, for example FLASK_APP=myproject.app:create_app('dev'). 2326
  • FLASK_APP can point to local packages that are not installed in editable mode, although pip install -e is still preferred. 2414
  • The ~views.View class attribute ~views.View.provide_automatic_options is set in ~views.View.as_view, to be detected by ~Flask.add_url_rule. 2316
  • Error handling will try handlers registered for blueprint, code, app, code, blueprint, exception, app, exception. 2314
  • Cookie is added to the response's Vary header if the session is accessed at all during the request (and not deleted). 2288
  • ~Flask.test_request_context accepts subdomain and url_scheme arguments for use when building the base URL. 1621
  • Set APPLICATION_ROOT to '/' by default. This was already the implicit default when it was set to None.
  • TRAP_BAD_REQUEST_ERRORS is enabled by default in debug mode. BadRequestKeyError has a message with the bad key in debug mode instead of the generic bad request message. 2348
  • Allow registering new tags with ~json.tag.TaggedJSONSerializer to support storing other types in the session cookie. 2352
  • Only open the session if the request has not been pushed onto the context stack yet. This allows ~stream_with_context generators to access the same session that the containing view uses. 2354
  • Add json keyword argument for the test client request methods. This will dump the given object as JSON and set the appropriate content type. 2358
  • Extract JSON handling to a mixin applied to both the Request and Response classes. This adds the ~Response.is_json and ~Response.get_json methods to the response to make testing JSON response much easier. 2358
  • Removed error handler caching because it caused unexpected results for some exception inheritance hierarchies. Register handlers explicitly for each exception if you want to avoid traversing the MRO. 2362
  • Fix incorrect JSON encoding of aware, non-UTC datetimes. 2374
  • Template auto reloading will honor debug mode even even if ~Flask.jinja_env was already accessed. 2373
  • The following old deprecated code was removed. 2385
    • flask.ext - import extensions directly by their name instead of through the flask.ext namespace. For example, import flask.ext.sqlalchemy becomes import flask_sqlalchemy.
    • Flask.init_jinja_globals - extend Flask.create_jinja_environment instead.
    • Flask.error_handlers - tracked by Flask.error_handler_spec, use Flask.errorhandler to register handlers.
    • Flask.request_globals_class - use Flask.app_ctx_globals_class instead.
    • Flask.static_path - use Flask.static_url_path instead.
    • Request.module - use Request.blueprint instead.
  • The Request.json property is no longer deprecated. 1421
  • Support passing a ~werkzeug.test.EnvironBuilder or dict to test_client.open <werkzeug.test.Client.open>. 2412
  • The flask command and Flask.run will load environment variables from .env and .flaskenv files if python-dotenv is installed. 2416
  • When passing a full URL to the test client, the scheme in the URL is used instead of PREFERRED_URL_SCHEME. 2430
... (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.


Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

You can always request more updates by clicking Bump now in your Dependabot dashboard.

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
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

Bumps [flask](https://github.com/pallets/flask) from 0.10.1 to 1.0. **This update includes security fixes.**
- [Release notes](https://github.com/pallets/flask/releases)
- [Changelog](https://github.com/pallets/flask/blob/master/CHANGES.rst)
- [Commits](pallets/flask@0.10.1...1.0)

Signed-off-by: dependabot-preview[bot] <[email protected]>
@dependabot-preview dependabot-preview bot added dependencies Pull requests that update a dependency file security Pull requests that address a security vulnerability labels Feb 13, 2020
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 security Pull requests that address a security vulnerability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants