5 ms·
Buffer Overflows in Notepad++
- nijave 3y agoThat's disappointing. I used to use Notepad++ heavily but it seems to have really lagged behind other lightweight text editors like Visual Studio Code
- hnuser123456 3y agoI'm going back and forth between those two and find it hard to leave NP++, but I know VSCode is superior in other ways besides minimalism. If the dev has a good response to this disclosure I'll probably continue to not be in a hurry to leave it.
- ulrischa 3y agoI also use both. Notepad++ is better for quick and dirty editing
- arthur2e5 3y agoIt's hard to beat an extensible project maintained by Microsoft with a Windows C++ project written by one guy. (I personally ditched n++ because the shell highlighting false-positives errors, and syntax errors are especially ugly in the default scheme. And it wasn't on GitHub back then, so complaining would be a chore.)
- wink 3y agoInterestingly my number #1 killer feature for N++ seems to be "having multiple unsaved files open and they are transparently saved and restored after restarting the app". In the past I've judged people who did this with a "just save your damn files" but since I, too, have converted to the ephemeral notes buffer where I don't want to find a location and file name to save it. The funny thing is that my N++ instance has ~5 files always opened, 3-4 of those buffers and when they get to 6 or 7 I trim them down to 3-4. This is probably the beginning of why we find people doing weird things...
- nijave 3y agoBeen using Bear on macOS (work) and Obsidian on Linux (personal use) for that now
- bakugo 3y agoVS Code is not at all lightweight compared to NP++.
- daef 3y agolightweight like vscode made me chuckle
- sumtechguy 3y agoOk it was not just me then. I use both. NP++ for like single documents or quick kanban lists for myself. VSCode is better for a group of closely related items such as when using it as an IDE. As I do not keep both open all the time NP++ usually wins on startup speed. Which fits my workflow.
- nebulous1 3y agoI think they wrote "lightweight text editor" but really they meant lightweight editors, with a loose classification of full-blown IDEs as heavyweight and everything lighter as lightweight, VSCode being the heaviest in the lightweight category.
- baal80spam 3y ago> lightweight text editors like Visual Studio Code I wouldn't call anything based on Electron "lightweight". My completely subjective list of text editors in order of lightweightness: Notepad2 - a feather Notepad++ - a dog VS Code - an elephant
- briHass 3y agoI haven't used it in a long time, but Textpad was my go-to ultra light. At the time, it only supported ASCII (no Unicode) so it only used one byte per character. I frequently had to open files that would hit 32 bit memory limits.
- esrauch 3y agoIf VS Code is an elephant than what are VS, IntelliJ, Eclipse? Skyscrapers? Aircraft carriers?
- layer8 3y agoWhales
- petepete 3y agoEclipse is a herd of cattle sellotaped together in the shape of a giant cow.
- eru 3y agoYes. Though they don't pretend to be text editors.
- delfinom 3y agoIntelliJ and VS are like two different models of US aircraft carrier Eclipse is like that one Russian aircraft carrier.
- pc86 3y agoThey're not text editors.
- 3y ago
- stockerta 3y agoDo you know what lightweight means?
- zb10948 3y ago200MB download, 500MB install. "Lightweight text editor" There are - text editors - programmers text editors - integrated development environments - rapid application development tools Sorted by size, reversely proportional to feature set. Basically VSCode is an overbloated #2, that isn't good enough to be #3 and is nowhere near #4. You could've fit a full blown RAD into 500MB (Borland C++ Builder) 20 years ago.
- flohofwoe 3y agoIt's 4 potential memory corruption issues in a 300kloc C/C++ code base, only one "may be critical" (without a working exploit being provided that's hard to tell). That's actually not too bad for an "unsafe" language.
- lelanthran 3y ago> It's 4 potential memory corruption issues in a 300kloc C/C++ code base, only one "may be critical" (without a working exploit being provided that's hard to tell). That's actually not too bad for an "unsafe" language. It's about normal. It's also why Rust is struggling to eat into C and C++ marketshare - the class bugs it prevents has such a tiny footprint compared to all the bugs present in any given C and C++ system that it doesn't motivate the developers to spend the time Rust requires to ramp up to speed on a new language, and then use it in production.
- not_the_fda 3y agoThis seems like a very narrow case with very low risk. You would have to have UTF-16 source code of unknown providence that you decide to load up and convert to UTF-8, and that source code would have to have some hidden exploit it. How likely is this scenario, I would say close to zero. You can't fix all of the bugs, nor should you try. You have balance bug fixing with feature development.
- layer8 3y agoAccording to TFA, just opening the file is sufficient to trigger the buffer overflow: “Open the file in Notepad++ to hit out of bounds access with ASAN.” Say, a *.txt file attached to an email, the opening of which in a text editor is usually considered benign.
- inferiorhuman 3y agoIdeally… yes. Consider that Windows APIs use UTF-16, not UTF-8, for wide characters. Microsoft's extensions to ISO 9660 used (big endian!) UCS-2 (a.k.a. UTF-16) for long filenames, NTFS uses proper UTF-16 I believe.
- arthur2e5 3y agoYou are right: NTFS exclusively runs on UCS-2, now "UTF-16 without validation". Back in the 1980s "Unicode" referred to a way to represent the ISO standard "Universal Character Set", i.e. UCS-2, instead of being synonymous to the entire character set like today. The wisdom of i18n back then was to use "Unicode" text encoding because it covered the known universe of writing. Qt made a similar choice.
- wolf550e 3y agoI think NTFS is UCS-2, that is why WTF-8 was invented https://simonsapin.github.io/wtf-8/ https://simonsapin.github.io/wtf-8/
- layer8 3y agoSurrogate pairs are interpreted by client software, so it’s UTF-16 in that sense. The file system just doesn’t ensure that there won’t be unpaired surrogates, or other noncharacters. This is similar to strings in .NET, Java, and JavaScript.
- rfmc 3y agoOff-topic: Checked out the N++ repo, and saw it's got 2.1k open issues and 7.2k closed ones, and this is from an org that seems to be just one or two devs. How's that even sustainable? I've got zero experience in maintaining big open-source projects, but those numbers would freak me out, to say the least. Way past what I'd call manageable.
- bombcar 3y agoIt’s just like people who have 40,000 unread emails. You just ignore the old ones.
- delfinom 3y agoWelcome to the reality of open source, it's a very limited few dedicated developers often supporting up hundred of thousands of users. The answer? Just maintain the project as the hobby it started as. Open source is provided without warranty and users are more than free to use the provided binaries for their convenience as-is or learn to compile to contribute fixes.
- psychphysic 3y agoYeah feature creep is a crime in open source projects. It's killed more useful projects than it's ever benefitted.
- delfinom 3y agoOne of the worst parts as a core developer of a OSS software is when you get drive-by pull requests of large changes without that person attempting pre-discussion. Said large changes try to introduce feature creep outside what the core team of dedicated developers that will actually stick around for years want or can actually maintain. You then end up with that drive-by pull requester spitting venom everywhere on twitter and other forums about how hostile the project is
- lelanthran 3y ago
- PrimeMcFly 3y agoFor a long time I wanted to write my own text editor, just extending SciTE to have sessions, syntax coloring, spell check and maybe a few other very basic things. Might be time to prioritize doing so. Edit: Not sure why this is being downvoted
- thomond 3y agoI can't tell if this comment is sarcasm or not
- PrimeMcFly 3y agoWhy would it be. Please elaborate.
- amiga386 3y agoIn this case, there are 4 bugs. One causes N++ to write 1 to 3 bytes past the end of a buffer, the other bugs cause N++ to read some bytes past the end of heap objects, even the researchers aren't sure how they could be exploited. While it's good they're fixed, it looks pretty much like what you get running code in a fuzzer with ASan enabled - finding obscure and very difficult to exploit memory correctness bugs. Unless a miracle happens and those 3 bytes can be made to belong to some very important structure, there's not much can be done with control of those 3 bytes.
- boxed 3y ago> 2023-08-15: Notepad++ v8.5.6 without the fixes was released. > 2023-08-21: Publishing according to our coordinated disclosure policy. I read it as NOT fixed.
- amiga386 3y agoOh, that's more concerning. > 2023-07-17: Asked the maintainer if they successfully downloaded the binary PoC, if they have any questions and notified about the disclosure policy. No reply received. It doesn't sound like there's a dispute over these being bugs, but the author has forgotten or ignored this issue? But still.. * Headline: BUFFER OVERFLOWS! WRITES! (MAYBE) ARBITRARY CODE EXECUTION! * Details: we can make it continue 1 extra cycle of a loop to write beyond a string buffer boundary. We can't make it perform arbitrary code execution but you never know. If the string buffer abuts something important in memory (e.g. a return address on the stack), or you can manipulate things so that it does, then even 1 byte write is bad, so I wouldn't dismiss it out of hand... but it does seem like the researchers didn't find anything useful to do with their 3-byte overflow write. Hopefully the author picks this up and fixes it.
- nyouhd 3y ago[dead]
- BoardsOfCanada 3y agoAccording to the article, just opening a malicious file may lead to arbitrary code execution, no? Edit: will -> may
- caporaltito 3y agoI always said it: they should work more on their code, not on which kiss-up political title the next version will have.