Skip to content
DoS Disclosed report Intermediate CVE-2019-11693

could be trigger oom problem with WebGLBuffer::BufferData

The WebGLBuffer::BufferData function in Firefox lacks a proper size check, allowing a crafted WebGL call to trigger an out-of-memory condition. An attacker could potentially crash the browser or cause a denial of service.

crixer Follow

Originally disclosed on Mozilla

  • Fixed in 55 days
  • Paid in 55 days
  • Disclosed after 55 days
Text
Created attachment 9048397
1.html

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36

Steps to reproduce:


void WebGLBuffer::BufferData(GLenum target, size_t size, const void* data,
                             GLenum usage) {
  // Careful: data.Length() could conceivably be any uint32_t, but GLsizeiptr
  // is like intptr_t.
  if (!CheckedInt<GLsizeiptr>(size).isValid())
    return mContext->ErrorOutOfMemory("bad size");

  if (!ValidateBufferUsageEnum(mContext, usage)) return;

#ifdef XP_MACOSX
  // bug 790879
  if (mContext->gl->WorkAroundDriverBugs() && size > INT32_MAX) {
    mContext->ErrorOutOfMemory("Allocation size too large.");
    return;
  }
#endif

  const void* uploadData = data;

  UniqueBuffer newIndexCache;
  if (target == LOCAL_GL_ELEMENT_ARRAY_BUFFER &&
      mContext->mNeedsIndexValidation) {
    newIndexCache = malloc(size);
    if (!newIndexCache) {
      mContext->ErrorOutOfMemory("Failed to alloc index cache.");
      return;
    }
    memcpy(newIndexCache.get(), data, size);
    uploadData = newIndexCache.get();
  }

The bufferdata function does not have an appropriate check for size value.
This coulde cause problems in the attached code.
I think it's almost impossible to exploit, but I think it's a security issue. :)

The original report as published on Mozilla's Bugzilla, by crixer. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the size parameter passed to WebGLBuffer::BufferData is not validated against a reasonable maximum before attempting memory allocation.

Impact

This could cause an out-of-memory condition, potentially crashing the browser (denial of service); the reporter thinks exploitation is almost impossible.

What the attacker needed

Victim visits a malicious webpage

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

WebGL is a browser feature for rendering 3D graphics. A function that allocates memory for WebGL buffers did not check how large the requested size was, so a malicious webpage could ask for an enormous amount of memory and crash the browser.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by crixer

View all

2 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.