
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
A hCaptcha extension for Flask based on flask-recaptcha.
Flask-hCaptcha 0.6.0 will be the last version that support Python 2, 3.5 and 3.6.
pip install flask-hcaptcha
from flask import Flask
from flask_hcaptcha import hCaptcha
app = Flask(__name__)
hcaptcha = hCaptcha(app)
#or
hcaptcha = hCaptcha()
hcaptcha.init_app(app)
Inside of the form you want to protect, include the tag: {{ hcaptcha }}
It will insert the code automatically
<form method="post" action="/submit">
... your field
... your field
{{ hcaptcha }}
[submit button]
</form>
In the view that's going to validate the captcha
from flask import Flask
from flask_hcaptcha import hCaptcha
app = Flask(__name__)
hcaptcha = hCaptcha(app)
@route("/submit", methods=["POST"])
def submit():
if hcaptcha.verify():
# SUCCESS
pass
else:
# FAILED
pass
hCaptcha.init(app, site_key, secret_key, is_enabled=True)
hCaptcha.get_code(dark_theme=False)
Returns the HTML code to implement. But you can use
{{ hcaptcha }} directly in your template. A dark
theme
can also be specified with dark_theme=True
.
hCaptcha.verify()
Returns bool
Just include {{ hcaptcha }} wherever you want to show the hcaptcha
Flask-hCaptcha is configured through the standard Flask config API. These are the available options:
HCAPTCHA_ENABLED: Bool - True by default, when False it will bypass validation
HCAPTCHA_SITE_KEY : Public key
HCAPTCHA_SECRET_KEY: Private key
HCAPTCHA_ENABLED = True
HCAPTCHA_SITE_KEY = ""
HCAPTCHA_SECRET_KEY = ""
© 2021 Knugi © 2015 Mardix
FAQs
A hCaptcha extension for Flask based on flask-recaptcha
We found that flask-hcaptcha demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.