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.
- Fixed in 55 days
- Paid in 55 days
- Disclosed after 55 days
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. :)
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.