Skip to main content

Gzip Bomb responses for Flask.

This package provides an extension to flask.Response class, GzipBombResponse, which can be used as a defensive measure for various vuln scans, dictionary attacks etc. It creates a response containing a gzipped data block filled with null characters with varying number of rounds (to achieve minimal size of response’s content).

Example:

>>> from flask import Flask
>>> from flask_gzipbomb import GzipBombResponse
>>>
>>> app = Flask(__name__)
>>>
>>> @app.route('/tiny-bomb')
... def gzipped():
...     return GzipBombResponse(size='1M')
>>>
>>> app.run()
>>> import gzip
>>> import requests
>>>
>>> r = requests.get('http://localhost:5000/tiny-bomb')
>>> r.headers['content-encoding']
'gzip,gzip'
>>> len(r.content) # gzipped content length in bytes
64
>>> data = gzip.decompress(r.content)
>>> data = gzip.decompress(data)
>>> len(data) # decompressed content length in bytes
1048576

GzipBombResponse accepts all arguments accepted by Response class with additional size parameter, describing response content length in bytes after decompression. Possible values:

‘1k’, ‘10k’, ‘100k’, ‘1M’, ‘10M’, ‘100M’, ‘1G’, ‘10G’

with k, M and G denoting kilobyte, megabyte and gigabyte. Any other value will result raise a KeyError. By default size is set to ‘10M’, however it is recommended to use ‘10G’ for achieving desired effect.

This package is for protection and educational purposes only. Using it for any malicious purpose is strictly prohibited.

Metadata

Release files for Flask-GzipBomb 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Flask-GzipBomb 0.1.0
File Size Uploaded Provenance Actions
Flask-GzipBomb-0.1.0.tar.gz 6.7 kB Without provenance Details for Flask-GzipBomb-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for Flask-GzipBomb 0.1.0
File Interpreter ABI Platform Actions
Flask_GzipBomb-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for Flask_GzipBomb-0.1.0-py2.py3-none-any.whl

Total release size: 15.9 kB

Release files / Flask-GzipBomb-0.1.0.tar.gz

Download URL Flask-GzipBomb-0.1.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6da1d0895bab4dd4e1e1cc404bc9ede17d98a2ed51655a5ad3d87394b422af50
BLAKE2b-256 checksum
How to use checksums
045c675bf06149f8d47a625431c8b2947580936c45de0021452e636882c70fe3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Flask_GzipBomb-0.1.0-py2.py3-none-any.whl

Download URL Flask_GzipBomb-0.1.0-py2.py3-none-any.whl
Size 9.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5d5e06a1929b49dc821369d8bf99760d2390adfe2ebcf8719c8a0b5d685ed05d
BLAKE2b-256 checksum
How to use checksums
8ba603634098faeef465b867d453a00152cfa7b67f09bb2489c0ad55214326aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for Flask-GzipBomb 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page