@remcp/remcp 0.2.113 → 0.2.115

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 +2 -2
  2. package/src/agent.mjs +14 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remcp/remcp",
3
- "version": "0.2.113",
3
+ "version": "0.2.115",
4
4
  "description": "ReMCP device client: pair a computer with ReMCP and run the outbound-only agent that hosts the local MCP runtime.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "directory": "packages/client"
32
32
  },
33
33
  "bugs": {
34
- "url": "https://github.com/getremcp/remcp/issues"
34
+ "url": "https://github.com/antonbaider/remcp/issues"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"
package/src/agent.mjs CHANGED
@@ -366,10 +366,23 @@ export async function runAgent(options) {
366
366
 
367
367
  function scheduleReconnect(delay) {
368
368
  if (stopping || revoked || reconnectTimer) return;
369
+ // Keep the upper-bound guard in control flow immediately before the timer sink. CodeQL's
370
+ // resource-exhaustion model treats this as a barrier, and future callers cannot retain the
371
+ // agent with an attacker-controlled timer lifetime.
372
+ const numericDelay = Number(delay);
373
+ if (!Number.isFinite(numericDelay)) {
374
+ scheduleReconnect(RECONNECT_BASE_MS);
375
+ return;
376
+ }
377
+ if (numericDelay > RECONNECT_MAX_MS) {
378
+ scheduleReconnect(RECONNECT_MAX_MS);
379
+ return;
380
+ }
381
+ const safeDelay = Math.max(100, Math.floor(numericDelay));
369
382
  reconnectTimer = setTimeout(() => {
370
383
  reconnectTimer = null;
371
384
  connect();
372
- }, delay);
385
+ }, safeDelay);
373
386
  reconnectTimer.unref?.();
374
387
  }
375
388