* User after Free in zftp module
@ 2024-05-10 8:26 Hamidreza
2024-05-10 10:14 ` Peter Stephenson
0 siblings, 1 reply; 2+ messages in thread
From: Hamidreza @ 2024-05-10 8:26 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 292 bytes --]
Hello,
There is a security vulnerablity in zftp module.
At `
https://github.com/zsh-users/zsh/blob/acdcf9d8542a4461c0fceb98fdfef7380a128f78/Src/Modules/zftp.c#L3149`,
`zfsessions` is begin freed but the variable is not set to NULL afterwards
which leads to a "Use after Free" bug.
Regards,
[-- Attachment #2: Type: text/html, Size: 502 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: User after Free in zftp module
2024-05-10 8:26 User after Free in zftp module Hamidreza
@ 2024-05-10 10:14 ` Peter Stephenson
0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2024-05-10 10:14 UTC (permalink / raw)
To: Hamidreza, zsh-workers
> On 10/05/2024 09:26 BST Hamidreza <0xxparrot1@gmail.com> wrote:
> There is a security vulnerablity in zftp module.
>
> At
> `https://github.com/zsh-users/zsh/blob/acdcf9d8542a4461c0fceb98fdfef7380a128f78/Src/Modules/zftp.c#L3149`,
> `zfsessions` is begin freed but the variable is not set to NULL
> afterwards which leads to a "Use after Free" bug.
Thanks, that's clear.
pws
diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c
index 0c26828..b60e5bf 100644
--- a/Src/Modules/zftp.c
+++ b/Src/Modules/zftp.c
@@ -3147,6 +3147,7 @@ zftp_cleanup(void)
lastmsg = NULL;
zfunsetparam("ZFTP_SESSION");
freelinklist(zfsessions, (FreeFunc) freesession);
+ zfsessions = NULL;
zfree(zfstatusp, sizeof(int)*zfsesscnt);
zfstatusp = NULL;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-10 10:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-10 8:26 User after Free in zftp module Hamidreza
2024-05-10 10:14 ` Peter Stephenson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).