peass-ng/PEASS-ng · error · FormatException

Charcorde over 0xffff is not supported

Error message

Charcorde over 0xffff is not supported

What it means

A decoder limit in UriEncoding.Unescape: while decoding %XX-escaped UTF-8 sequences the routine assembles code points and rejects any above 0xFFFF, because the output is built with (char)/UTF-16 code units and no surrogate-pair handling exists. It fires when the escaped input encodes a supplementary-plane character (e.g. emoji) as a 4-byte UTF-8 sequence.

Source

Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/UriEncoding.cs:138

                    p += 3;
                    result.Append((char)c0);
                    continue;
                }
                var c1 = ( HexToInt(s[p + 4]) << 4 ) + HexToInt(s[p + 5]);
                if ( c0 < 0xe0 ) {
                    p += 6;
                    var c = (char)( ( ( c0 & 0x1f ) << 6 ) + ( c1 & 0x7f ) );
                    result.Append(c);
                    continue;
                }
                var c2 = ( HexToInt(s[p + 7]) << 4 ) + HexToInt(s[p + 8]);
                if ( c0 < 0xf1 ) {
                    p += 9;
                    var c = (char)( ( ( c0 & 0x0f ) << 12 ) + ( ( c1 & 0x7f ) << 6 ) + ( c2 & 0x7f ) );
                    result.Append(c);
                    continue;
                }
                throw new FormatException("Charcorde over 0xffff is not supported");
            }
            return result.Append(s.Substring(p)).ToString();
        }
        static int HexToInt(char c)
        {
            return c <= '9' ? c - '0' : c < 'Z' ? c - 'A' + 10 : c - 'a' + 10;

        }
    }

}

View on GitHub (pinned to 53fb989abc)

Solutions

  1. Strip or percent-encode supplementary-plane characters before unescaping
  2. Decode with Uri.UnescapeDataString or a full UTF-8 decoder that emits surrogate pairs
  3. Validate input ranges and reject/escape non-BMP code points upstream
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at winPEAS/winPEASexe/winPEAS/3rdParty/YamlSerializer/UriEncoding.cs:138 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of peass-ng/PEASS-ng@53fb989abc (2026-09-02). Data as JSON: /api/errors/f62f48443f644734. Report an issue: GitHub.