kovidgoyal/kitty · error
Ignoring encrypted rc command with timestamp {delta / 1e9:.1
Error message
Ignoring encrypted rc command with timestamp {delta / 1e9:.1f} seconds from now. Could be an attempt at a replay attack or an incorrect clock on a remote machine. What it means
After decrypting an encrypted remote-control command, kitty compares its embedded timestamp with the local clock; if they differ by more than ±5 minutes the command is rejected to block replay attacks.
Source
Thrown at kitty/remote_control.py:72
if not isinstance(pcmd, dict) or 'version' not in pcmd:
log_error('JSON payload of remote command is invalid, must be an object with a version field')
return {}
pcmd.pop('password', None)
if 'encrypted' in pcmd:
if pcmd.get('enc_proto', '1') != RC_ENCRYPTION_PROTOCOL_VERSION:
log_error(f'Ignoring encrypted rc command with unsupported protocol: {pcmd.get("enc_proto")}')
return {}
pubkey = pcmd.get('pubkey', '')
if not pubkey:
log_error('Ignoring encrypted rc command without a public key')
d = AES256GCMDecrypt(encryption_key.derive_secret(base64.b85decode(pubkey)), base64.b85decode(pcmd['iv']), base64.b85decode(pcmd['tag']))
data = d.add_data_to_be_decrypted(base64.b85decode(pcmd['encrypted']), True)
pcmd = json.loads(data)
if not isinstance(pcmd, dict) or 'version' not in pcmd:
return {}
delta = time_ns() - pcmd.pop('timestamp')
if abs(delta) > 5 * 60 * 1e9:
log_error(
f'Ignoring encrypted rc command with timestamp {delta / 1e9:.1f} seconds from now.'
' Could be an attempt at a replay attack or an incorrect clock on a remote machine.'
)
return {}
return pcmd
class CMDChecker:
def __call__(self, pcmd: dict[str, Any], window: Optional['Window'], from_socket: bool, extra_data: dict[str, Any]) -> bool | None:
return False
@lru_cache(maxsize=64)
def is_cmd_allowed_loader(path: str) -> CMDChecker:
import runpy
try:
m = runpy.run_path(path)View on GitHub (pinned to 6d5d0c4406)
Solutions
- Sync clocks: enable NTP/chrony on both client and server machines
- Check timezone-independent system clock (UTC) correctness in VMs/dual-boot setups
- If it persists after sync, treat as suspicious and audit who has socket access
Defensive patterns
Strategy: validation
Validate before calling
from time import time_ns assert abs(time_ns() - payload['timestamp']) <= 5 * 60 * 1e9, 'clock skew > 5 min'
Prevention
- Run NTP/chrony on all machines using remote control
- Re-check clock sync in VMs and dual-boot setups before debugging kitty
When it happens
Trigger: abs(time_ns() - pcmd['timestamp']) > 5*60*1e9 — the sending machine's clock is >5min off, or a captured payload is being replayed.
Common situations: System clock drift / NTP not synced on the client machine, dual-boot clock skew, VMs with paused time, or genuine replay attempts.
Related errors
- This should be run as kitten icat
- This should be run as `kitten notify ...`
- Remote control not enabled, this kitten should be run via a
- The remote control password was invalid: {data!r}
- Remote control is not enabled, remember to use allow_remote_
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/4f1f70a70f803db1.
Report an issue: GitHub.