No basically secure: char mapFilename[256]; strcat(strcpy(mapFilename, getenv("HOME")), RESOURCES); strcat(mapFilename, mapName);
What's insecure? Can you explain what's the vulnerability here and how and by whom can it be exploited?
Show HN: X11 desktop widget that shows location of your network peers on a map
31–40 of 90 posts
Re: Show HN: X11 desktop widget that shows location of your network peers on a map
#32Re: Show HN: X11 desktop widget that shows location of your network peers on a map
#33No basically secure: char mapFilename[256]; strcat(strcpy(mapFilename, getenv("HOME")), RESOURCES); strcat(mapFilename, mapName);
While that's indeed a bug, for it to be a security vulnerability, wouldn't there also have to be a security boundary involved? Specifically, mapName is always either "w1000b.png" or "w1000.png", so the only way to trigger the buffer overflow would be through the HOME environment variable. But if an attacker can run commands as you with arbitrary environment variables, aren't you already pwned? What would anyone gain…
Re: Show HN: X11 desktop widget that shows location of your network peers on a map
#34Pretty cool! Reminds me of the game Uplink.
Re: Show HN: X11 desktop widget that shows location of your network peers on a map
#35Re: Show HN: X11 desktop widget that shows location of your network peers on a map
#36Re: Show HN: X11 desktop widget that shows location of your network peers on a map
#37Earlier quoted context omitted.
Those 3 dots are your peers, the other end of the TCP connection :) So you basically have some apps running in the background (or foreground) that are making those connections.
Okay, got it, thanks. I suppose it could also be the FIOS router itself making those connections, or any of the other systems on my local network.
Re: Show HN: X11 desktop widget that shows location of your network peers on a map
#38Earlier quoted context omitted.
Yeah, that is not a helpful attitude to take when it comes to this sort of thing. If nothing else, a super-long home path can crash your app and leave your user scratching their head. In other words, this is a bug (as is the fact that paths are not necessarily limited to 255 characters in the first place; see the PATH_MAX constant, I think it is?). As to what could be accomplished with an overflow? I don't know; I'm…
Thanks for the discussion. Fix is already committed.