@webdecoy/fcaptcha 1.29.0 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webdecoy/fcaptcha",
3
- "version": "1.29.0",
3
+ "version": "1.30.0",
4
4
  "description": "Open source CAPTCHA with PoW, bot detection, and Vision AI protection",
5
5
  "main": "index.js",
6
6
  "exports": {
package/server.js CHANGED
@@ -1704,7 +1704,7 @@ app.post('/api/score', async (req, res) => {
1704
1704
  });
1705
1705
 
1706
1706
  app.post('/api/token/verify', (req, res) => {
1707
- const { token, secret } = req.body;
1707
+ const { token, secret, remoteip } = req.body;
1708
1708
 
1709
1709
  // The secret gate. This endpoint is the boundary between "a browser finished a
1710
1710
  // challenge" and "my backend believes it", so it is server-to-server and needs
@@ -1719,10 +1719,10 @@ app.post('/api/token/verify', (req, res) => {
1719
1719
  }
1720
1720
  }
1721
1721
 
1722
- // Extract client IP for verification
1723
- const ip = PROXY_TRUST.clientIP(req);
1724
-
1725
- res.json(verifyToken(token, ip));
1722
+ // This request comes from the integrating backend, not from the visitor who
1723
+ // received the token. Bind only when that trusted backend explicitly supplies
1724
+ // the visitor address; using the caller socket here compares unrelated hosts.
1725
+ res.json(verifyToken(token, typeof remoteip === 'string' && remoteip ? remoteip : null));
1726
1726
  });
1727
1727
 
1728
1728
  // Turnstile / reCAPTCHA / hCaptcha drop-in compatibility.