5 ms·
Symlinks work as intended, but they cause a lot of unintended security vulnerabilities, i.e. they break lots of otherwise-functioning code. You can play with y
by joosters 4y ago
Symlinks work as intended, but they cause a lot of unintended security vulnerabilities, i.e. they break lots of otherwise-functioning code.
You can play with your words and redefine their meanings, but the vulnerabilities remain.
- mongol 4y agoThey have been around for 40+ years, they don't break code unless we are talking about code predating their introduction. It is not me playing with words, I am just pointing out a tired trope.
- rob_c 4y ago> but they cause a lot of unintended security vulnerabilities No, bad coders on UNIX platforms do this. The code may be valid code, but if it's intending to support running on UNIX it should do it properly not assuming it's on a FAT32 filesystem in 2022. Or, even better, run the code you don't trust on fat32 filesystems, see how far that gets.
- joosters 4y agoDon't victim blame. Do you really think that using open(), stat(), lstat() (!), realpath(), mkdir(), rename() etc etc etc is a sign of a bad coder? The problem is that the APIs set you up for unexpected failure, and even some of the provided workarounds to 'safely' handle symlinks don't do it well enough. In the case of symlinks, I think it's fair to blame the tools rather than the workman.
- zx8080 4y agoAPI is always simplification and is not supposed to be used without understanding concepts and reality under the hood. Example: wanna show 1M POI in browser on some small territory. Openmaps/googlemaps API allows that, no prob. Looks good, yeah? Sorry, doesn't work. Because 1M is too large to show and browser gets stuck. The API do not prevent _all_ kinds of legshooting engineers invent.
- rob_c 4y agoDon't worry, they don't listen to speaking out against bigG or others for being bad
- rob_c 4y agoThis is not victim blame. RTFM READ IT!!! Most sane languages and low level tools describe what you want and how to work correctly. If you don't want this feature in the filesystem, move to one that doesn't support it, or better yet submit a patch to run the filesytem you want with this feature deactivted for "security concerns". Demanding a whole OS change the way it works for bad/lazy/inept coders is akin to 2 people getting blind drunk and blaming the other person or the drink for the stupid things they did. Take some responsibility.
- com2kid 4y ago> Demanding a whole OS change the way it works for bad/lazy/inept coders is akin to 2 people getting blind drunk and blaming the other person or the drink for the stupid things they did. Take some responsibility. And if people were just more careful, none of rust's memory safety stuff is needed! Also, why do modern languages hand hold multi-threading so much, just give developers some mutex primitives and let them have at it, the good coders will be just fine! Of course the rest of us will have to deal with machines getting pwned due to security bugs, but hey, at least the "well written" programs won't have those problems...
- rob_c 4y agoStop defending poor coding and lack of skill. Everything you're saying is an excusory situation for hiring poor coders at minimum wage who can't or won't read documentation. This is 80IQ points South of frankly most of the conversations on here. Yes the rest of us cope with security incidents. There will always be security incidents. Stop defending practices that leads to them.
- com2kid 4y ago> Stop defending poor coding and lack of skill. This is a hopelessly elitist attitude. Also it is a useless one, over 1000 CVEs, yelling "be better at your job!" is just going to result in another 1000 CVEs. That is exactly what happened for decades with buggy C code, buffer overflows and use after frees, for a long time the refrain was "just do better!". Well millions of dollars of damages later, it turns out berating people to "just do better" doesn't actually make things any better. A combination of static analysis and runtime tooling, and then the eventual creation of new programming languages that allow for correct modeling of memory ownership, is what the industry en masse has decided on. For APIs that get misused? The solution is to provide higher level APIs that allow programmers to easily accomplish the correct thing in a secure manner. As an aside, and in general, when designing software, I want to maximize the amount of brain power I am dedicating to solving the business problem at hand. Dealing with poorly designed insecure APIs detracts from me getting my actual job done. > Stop defending practices that leads to them. The practice in this case is the direct use of filesystem APIs that were designed in the 1970s for a very different security ecosystem than what exists today. Lots of things designed in the 1970s are not secure by default. Heck most things designed in the 1970s, outside of maybe some IBM Mainframe stuff, was not designed to be secure by default. What you are arguing is that instead of buying a fire extinguisher to put in the kitchen of an old house, people should just try and not set things on fire. I mean, yeah, sure, good goal, but buy the fire extinguisher anyway.
- the8472 4y agoPart of the problem is that handles on directories on which one can then use the the *at family of syscalls are not first-class citizens in many programming languages. Which in turn might be due to portability concerns with windows, e.g. Java's SecureDirectoryStream isn't available there[0]. Apparently windows does have an openat-like API[1], but it's low-level. Programmers aren't using them because the language standard libraries point them in the wrong direction. [0] https://github.com/google/guava/wiki/Release21#user-content-commonio https://github.com/google/guava/wiki/Release21#user-content-... [1] https://github.com/rust-lang/rust/blob/1c63ec48b8cbf553d291a04957d86cfd191fcd78/library/std/src/sys/windows/fs.rs#L711-L715 https://github.com/rust-lang/rust/blob/1c63ec48b8cbf553d291a...
- ziml77 4y agoWeird that you need to dip down to an Nt* function to open a child given a parent handle. It's not like it's unheard of to be able to do that in the Windows API. The registry is also a hierarchical system and opening any key requires passing in a parent key handle (the root handles are predefined).
- ChrisSD 4y agoIt's a quirk of history, imho. If Win32 had been written without concern for what came before, it probably would have more closely followed NT conventions. But it wasn't. It followed on from Win16 and DOS so, to an extent, it emulated DOS-style path and file handling. After all, that's what developers and users were familiar with. The Windows registry did not have all this baggage so it followed the style of the NT kernel. Though this doesn't explain why Win32 never added CreateFileRelativeToDirectoryHandleW
- rob_c 4y agoThis a serious issue in support of the language for running on a UNIX system. Frankly blaming the kernel/filesystem for this is like saying I want my 720p monitor to display 8k correctly, it must be the display-drivers fault...
- pif 4y ago> they break lots of otherwise-functioning code. There is no otherwise! POSIX has symbolic links: if your software does not function with symbolic links, it does not function on POSIX.
- IshKebab 4y agoOf course there is otherwise. Windows (more or less) doesn't have symlinks. Plan9 doesn't have symlinks. You don't have to have symlinks. Can you not imagine anything other than POSIX?
- indymike 4y ago> You can play with your words and redefine their meanings, but the vulnerabilities remain. I don't think OP was trying to play with words, I do think there's an absolute "this symlink thing is a vuln" vs an absolute "I use symlinks to make X work" argument. Symlinks have always been at the line between the absolutes. They do enable a great deal of functionality but they can be a security risk, and source of bugs when developers don't handle them correctly. That said, they are heavily used feature on unix like oses. My /usr/bin on Ubuntu has 48 of them (most were put there by apt installed packages).
- deleted 4y ago[deleted]