Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVE-2004-2014 still unpatched #29

Open
hugusmaximus opened this issue Nov 26, 2024 · 1 comment
Open

CVE-2004-2014 still unpatched #29

hugusmaximus opened this issue Nov 26, 2024 · 1 comment

Comments

@hugusmaximus
Copy link

This vulnerability:

https://nvd.nist.gov/vuln/detail/CVE-2004-2014

was reported 20 years ago. It is still working on Wget 1.21.4

Here original details:

https://bugs.gentoo.org/51365

Fix is simple: just lock the file where Wget will write the downloaded file. A safe programming approach would be to use O_CREAT | O_EXCL when creating a file

This approach ensures that the file is created and locked atomically. If the file already exists (even as a symlink), the operation will fail.

Best,

@hugusmaximus
Copy link
Author

I think Wget should enable atomic creation and locking by default, and we could add an option to disable this behavior (for backward compatibility with edge cases where atomicity isn’t necessary).

So my new proposed behavior would be:

Default: Secure file creation (atomic + locked).
Optional: --no-atomic or --insecure-write for legacy use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant