lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi there,

The description of CVE-2021-43519 is as followed [0]:

| Stack overflow in lua_resume of ldo.c in Lua Interpreter 5.1.0~5.4.4
| allows attackers to perform a Denial of Service via a crafted script
| file.

I'm wondering about the “5.1.0~5.4.4” part.  According to the original thread [1]
it was fixed upstream by
(v5.4.4) and appears to correspond to
which is marked as “existed since 5.4.2”.

I believe the issue was introduced upstream by
(v5.4.2) i.e., when incrementing L->nCcalls was moved to resume() from
lua_resume().  (As the original report mentions, resume() is called via
luaD_rawrunprotected() which resets the state on error.)

I'm able to reproduce the crash with v5.0 to v5.1.2, but I believe this is an
unrelated issue which is listed at .
Similarly, the original PoC yields a crash with v5.2.0, which I believe is due
to this unrelated issue: .  Either way,
I'm unable to reproduce the crash with v5.1.x from v5.1.3, nor with v5.2.x from

Furthermore I'm unable to reproduce the crash with any of the v5.3.x releases (built
from lua-all.tar.gz), and indeed there L->nCcalls is incremented in lua_resume()
i.e., outside LUAI_THROW: .

Is the range of affected versions from the CVE description incorrect?  If so
could you please confirm that only v5.4.2 and v5.4.3 are affected, and that the
vulnerability was introduced by the aforementioned 287b302a?