Website reCAPTCHA v2
website_recaptcha_v2 · OCA/website
-
Security10/251 grave, 0 minor
-
Activity20/25Last human commit 11 months ago
-
Required by5/250 modules depend on it
-
Maturity12/25In 2 Odoo series since 16.0
Heuristic over the facts below, not an audit · How it's computed
Security warnings
website— Adds credential fields (recaptcha_v2_secret_key) with no `groups=` to 'website', which every user (portal/public included) can read under core's access rights: they can read them over RPC. Restrict the fields with `groups=` (e.g. base.group_system). CWE-200. acl-public-read-secret
Found by automated static analysis: these patterns are usually risky, but only a manual review of the module can confirm a real issue. Methodology
Description
This module allows to use reCAPTCHA v2 on website forms.
It is a helper module that only provides the widget and the validation logic which can be used by other modules to actually display it on website forms and check whether the user entry is valid.
This module originally comes from website_recaptcha_reloaded from Tech
Receptives, which itself comes from website_recaptcha from Elico Corp.
Dependencies
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 2
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
recaptcha_widget |
reCAPTCHA widget | ir.ui.view | qweb | New |
res_config_settings_view_form |
Website settings | res.config.settings | form | Inherits website.res_config_settings_view_form |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 2
-
recaptcha_v2_enabledBooleanreadonly=Falserelated='website_id.recaptcha_v2_enabled' -
recaptcha_v2_secret_keyCharreadonly=Falserelated='website_id.recaptcha_v2_secret_key' -
recaptcha_v2_site_keyCharreadonly=Falserelated='website_id.recaptcha_v2_site_key'
No public methods.
-
recaptcha_v2_enabledBooleanargs: 'Enable reCAPTCHA v2' -
recaptcha_v2_secret_keyCharargs: 'Secret Key (v2)' -
recaptcha_v2_site_keyCharargs: 'Site Key (v2)'
-
is_recaptcha_v2_valid(self, form_values)Checks whether the reCAPTCHA v2 challenge has been correctly solved. form_values must be a dictionary containing the form values. Returns a (bool, str) tuple. The first element tells whether the CAPTCHA is valid or not. The second is the error message when applicable (or an empty string). If reCAPTCHA is disabled in the settings, this method behaves as if the CAPTCHA was correctly solved, but without doing any check.
Loading…