Exploit database

GH-77b084c651f84d76fe59d880f4600f96

genaforvena/mishe-tauftauf2shell

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-109618

412 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files3

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

lab/frontier/live555vorbis2shell/h/sink_fixed.cpp

C++ · 3,220 bytes
// Generated by gen_sink.py from pins/; no upstream bytes edited.
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
typedef int Boolean;
enum { False = 0, True = 1 };
u_int8_t* base64Decode(char const* str, unsigned& resultSize);
#line 119 "liveMedia/VorbisAudioRTPSource.cpp"
////////// parseVorbisOrTheoraConfigStr() implementation //////////

#define ADVANCE(n) do { p += (n); rem -= (n); } while (0)
#define GET_ENCODED_VAL(n) do { u_int8_t byte; n = 0; do { if (rem == 0) break; byte = *p; n = (n*128) + (byte&0x7F); ADVANCE(1); } while (byte&0x80); } while (0); if (rem == 0) break

void parseVorbisOrTheoraConfigStr(char const* configStr,
                                  u_int8_t*& identificationHdr, unsigned& identificationHdrSize,
                                  u_int8_t*& commentHdr, unsigned& commentHdrSize,
                                  u_int8_t*& setupHdr, unsigned& setupHdrSize,
				  u_int32_t& identField) {
  identificationHdr = commentHdr = setupHdr = NULL; // default values, if an error occur
  identificationHdrSize = commentHdrSize = setupHdrSize = 0; // ditto
  identField = 0; // ditto

  // Begin by Base64-decoding the configuration string:
  unsigned configDataSize;
  u_int8_t* configData = base64Decode(configStr, configDataSize);
  u_int8_t* p = configData;
  unsigned rem = configDataSize;

  do {
    if (rem < 4) break;
    u_int32_t numPackedHeaders = (p[0]<<24)|(p[1]<<16)|(p[2]<<8)|p[3]; ADVANCE(4);
    if (numPackedHeaders == 0) break;

    // Use the first 'packed header' only.
    if (rem < 3) break;
    identField = (p[0]<<16)|(p[1]<<8)|p[2]; ADVANCE(3);

    if (rem < 2) break;
    u_int16_t length = (p[0]<<8)|p[1]; ADVANCE(2);

    unsigned numHeaders;
    GET_ENCODED_VAL(numHeaders);

    Boolean success = False;
    for (unsigned i = 0; i < numHeaders+1 && i < 3; ++i) {
      success = False;
      unsigned headerSize;
      if (i < numHeaders) {
        // The header size is encoded:
	GET_ENCODED_VAL(headerSize);
        if (headerSize > length) break;
        length -= headerSize;
      } else {
	// The last header is implicit:
        headerSize = length;
      }

      // Allocate space for the header bytes; we'll fill it in later
      if (i == 0) {
	identificationHdrSize = headerSize;
        identificationHdr = new u_int8_t[identificationHdrSize];
      } else if (i == 1) {
        commentHdrSize = headerSize;
	commentHdr = new u_int8_t[commentHdrSize];
      } else { // i == 2
        setupHdrSize = headerSize;
        setupHdr = new u_int8_t[setupHdrSize];
      }

      success = True;
    }
    if (!success) break;

    // Copy the remaining config bytes into the appropriate 'header' buffers:
    if (identificationHdr != NULL) {
      if (rem < identificationHdrSize) break;
      memmove(identificationHdr, p, identificationHdrSize); ADVANCE(identificationHdrSize);
    }
    if (commentHdr != NULL) {
      if (rem < commentHdrSize) break;
      memmove(commentHdr, p, commentHdrSize); ADVANCE(commentHdrSize);
    }
    if (setupHdr != NULL) {
      if (rem < setupHdrSize) break;
      memmove(setupHdr, p, setupHdrSize); ADVANCE(setupHdrSize);
    }
  } while (0);

  delete[] configData;
}