Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-google-invisible-recaptcha
Advanced tools
A React component which is simply interested in Google invisible reCaptcha.
A React component which is interested in only Google invisible reCAPTCHA.
// Version 0.x
<Recaptcha ref={ref => this.recaptcha = ref} ... />
// this.recaptcha.execute invokes the reCAPTCHA check.
// Version 1.0.0
const refCaptcha = React.useRef(null) // or React.createRef().
<Recaptcha ref={refRecaptcha} ... />
// refRecaptcha.current.callbacks.execute invokes the reCAPTCHA check.
// ^^^^^^^^^^^^^^^^^^
Type something in an input box and click the button to submit data. The value is then checked to make up example client-side validation. Only valid input triggers reCAPTCHA. Since the reCAPTCHA is invisible, it proceeds most likely as if none is attached. You will only be present the figure of the reCAPTCHA when Google hesitates to tell your identity.
When reCAPTCHA is resolved, the demo page shows the result token for demo purpose. In a real application, it should be used with a HTTP request targeting at https://www.google.com/recaptcha/api/siteverify?secret=<secret>&response=<token>
on the server to validate the reCAPTCHA result before any sensitive operation is performed. Checking input values derived from clients on the server imporves security as well.
See the example/
folder for an example.
// 1.0.0 prerelease.
npm install react-google-invisible-recaptcha@next --save
npm install react-google-invisible-recaptcha --save
import Recaptcha from 'react-google-invisible-recaptcha';
<Recaptcha
onResolved={() => console.log('Human detected.')} />
ref={refRecaptcha}
sitekey={<sitekey>}
Set required props to get going.
A few optional props you can tweak.
bottomright
, bottomleft
, or inline
. Default: bottomright.// Functional component with React hooks.
const refRecaptcha = React.useRef(null);
<Recaptcha ref={refRecaptcha} ... />
// Class component.
this.refRecaptcha = React.createRef();
<Recaptcha ref={refRecaptcha} ... />
// refRecaptcha.current.callbacks.execute function which invokes the reCAPTCHA check.
// refRecaptcha.current.callbacks.reset function which resets the reCAPTCHA widget.
// refRecaptcha.current.callbacks.getResponse function which returns the response token.
MIT. See LICENSE.md for details.
FAQs
A React component which is simply interested in Google invisible reCaptcha.
The npm package react-google-invisible-recaptcha receives a total of 4,539 weekly downloads. As such, react-google-invisible-recaptcha popularity was classified as popular.
We found that react-google-invisible-recaptcha demonstrated a not healthy version release cadence and project activity because the last version was released 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.