buffer: avoid overrun on UCS-2 string write · nodejs/node@0052926 · GitHub
Skip to content

Commit 0052926

Browse files
committed
buffer: avoid overrun on UCS-2 string write
CVE-2018-12115 Discovered by ChALkeR - Сковорода Никита Андреевич Fix by Anna Henningsen Writing to the second-to-last byte with UCS-2 encoding will cause a -1 length to be send to String::Write(), writing all of the provided Buffer from that point and beyond. Fixes: nodejs-private/security#203 PR-URL: nodejs-private/node-private#138
1 parent 08a150f commit 0052926

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

src/string_bytes.cc

Lines changed: 5 additions & 1 deletion

test/parallel/test-buffer.js

Lines changed: 21 additions & 0 deletions

0 commit comments

Comments
 (0)