diff options
| author | zeertzjq <zeertzjq@outlook.com> | 2026-06-25 08:17:38 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-25 00:17:38 +0000 |
| commit | e715122e4e2e25bc3530f164668ec392cfb195a7 (patch) | |
| tree | 8fa8b995332d397eb61632e4b72b4f048965ece2 /test/functional/vimscript/executable_spec.lua | |
| parent | 12ded1f36c2c47fa66ce62f29692392c448ea1e9 (diff) | |
| download | rneovim-e715122e4e2e25bc3530f164668ec392cfb195a7.tar.gz rneovim-e715122e4e2e25bc3530f164668ec392cfb195a7.tar.bz2 rneovim-e715122e4e2e25bc3530f164668ec392cfb195a7.zip | |
vim-patch:9.2.0725: [security]: Stack out-of-bounds write in spell_soundfold_sal() (#40402)
Problem: [security]: A crafted spell file with non-collapsing SAL rules
can make soundfold() write one byte past the end of the
MAXWLEN result buffer. This is the same class of
out-of-bounds write as GHSA-q8mh-6qm3-25g4 (fixed in 9.2.0698
for the SOFO branch), found while auditing the surrounding
code.
Solution: Bound the single-byte SAL result writes and the terminating
NUL to MAXWLEN - 1, matching the SOFO branch.
The single-byte branch of spell_soundfold_sal() guarded its writes with
"reslen < MAXWLEN", allowing reslen to reach MAXWLEN (254). The trailing
"res[reslen] = NUL" then wrote at index 254 of the 254-byte stack buffer
res[MAXWLEN], an off-by-one out-of-bounds write. Input is case-folded to
about 253 characters, so a 253-character argument together with a SAL map
that does not collapse (collapse_result false) reaches the boundary.
Related to previous issue
[GHSA-q8mh-6qm3-25g4](https://github.com/vim/vim/security/advisories/GHSA-q8mh-6qm3-25g4)
(9.2.0698)
Github Security Advisory:
https://github.com/vim/vim/security/advisories/GHSA-m3hf-xcm3-xhm2
https://github.com/vim/vim/commit/d22ff1c955ff87e8273210eae125aab0e85b6c30
This is N/A as Nvim doesn't have spell_soundfold_sal() which is only
used in the !has_mbyte code path.
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'test/functional/vimscript/executable_spec.lua')
0 files changed, 0 insertions, 0 deletions