Skip to content
This repository was archived by the owner on Apr 5, 2026. It is now read-only.
This repository was archived by the owner on Apr 5, 2026. It is now read-only.

Testing: fuzz MTProto obfuscated2 frame parser #57

@dvershinin

Description

@dvershinin

Context

Follow-up from #51. The obfuscated2 frame parser was not included in the initial fuzz testing work because it is deeply coupled to AES crypto and connection state.

What needs fuzzing

In net/net-tcp-rpc-ext-server.c, the obfuscated2 handshake path:

  • 64-byte random header parsing
  • AES-CTR key/IV derivation from the header
  • Tag detection at offset 56 after decryption (0xdddddddd, 0xeeeeeeee, 0xefefefef)
  • Target DC extraction at offset 60
  • Compact/medium frame length parsing (1-byte and 4-byte variants)

Approach

Requires refactoring to decouple from:

  • connection_info structs and rwm_* message buffers
  • AES encryption context setup (net-crypto-aes.c)
  • Global state (ext_secret, connection type tables)

One approach: extract the post-decryption parsing (tag detection, DC extraction, frame length validation) into a standalone function that takes a flat 64-byte buffer.

Priority

Medium — this code handles untrusted input but only after the initial TLS/obfuscated2 layer is negotiated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions