{"record":{"id":"dd86d12af641f7c9","repo":"kovidgoyal/kitty","slug":"clipboard-alias-request-payload-is-not-valid-base6","errorCode":null,"errorMessage":"Clipboard alias request payload is not valid base64 encoded UTF-8, aborting the write request. Error: {e}","messagePattern":"Clipboard alias request payload is not valid base64 encoded UTF-8, aborting the write request\\. Error: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/clipboard.py","lineNumber":446,"sourceCode":"                protocol_type=ProtocolType.osc_5522,\n                id=sanitize_id(m.get('id', '')),\n                human_name=m.get('name', ''),\n                password=m.get('pw', ''),\n            )\n            self.handle_write_request(self.in_flight_write_request)\n        elif typ == 'walias':\n            wr = self.in_flight_write_request\n            if wr is None:\n                return\n            mime = m.get('mime', '')\n            if not mime:\n                log_error('Clipboard alias request has no MIME type, aborting the write request')\n                self.abort_write_request(wr, 'EINVAL')\n                return\n            try:\n                aliases = strict_base64_decode(epayload).decode('utf-8').split()\n            except Exception as e:\n                log_error(f'Clipboard alias request payload is not valid base64 encoded UTF-8, aborting the write request. Error: {e}')\n                self.abort_write_request(wr, 'EINVAL')\n                return\n            for alias in aliases:\n                wr.aliases[alias] = mime\n        elif typ == 'wdata':\n            wr = self.in_flight_write_request\n            if wr is None:\n                return\n            mime = m.get('mime', '')\n            try:\n                if not mime:\n                    self.commit_write_request(wr)\n                    return\n                wr.add_base64_data(epayload, mime)\n            except OSError:\n                self.abort_write_request(wr, 'EIO')\n                raise\n            except ValueError as e:","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/clipboard.py#L428-L464","documentation":"The walias message's alias-list payload failed strict base64/UTF-8 decoding; kitty aborts the in-flight write request with EINVAL.","triggerScenarios":"type=walias with epayload that is not strict base64 of UTF-8 alias names.","commonSituations":"Unencoded alias strings, trailing whitespace breaking strict base64, or truncated sequences.","solutions":["Base64-encode the alias list exactly (no whitespace/padding tricks)","Test payloads with python -c 'import base64; base64.b64decode(s, validate=True)'"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import base64\ndef enc_aliases(names):\n    return base64.b64encode(' '.join(names).encode('utf-8')).decode('ascii')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Strict-base64-encode alias lists with no embedded whitespace"],"tags":["kitty","clipboard","osc5522","base64"],"backgroundTag":"base64-decode-invalid-input","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}