Skip to contentSkip to conversation

package/pure-ftpd: fix CVE-2020-9274

PATCH New Fabrice Fontaine 3 participants 3 messages Mar 28, 2020 – Apr 7, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/pure-ftpd: fix CVE-2020-9274

An issue was discovered in Pure-FTPd 1.0.49. An uninitialized pointer vulnerability has been detected in the diraliases linked list. When the *lookup_alias(const char alias) or print_aliases(void) function is called, they fail to correctly detect the end of the linked list and try to access a non-existent list member. This is related to init_aliases in diraliases.c.

---
 ...ays-set-the-tail-of-the-list-to-NULL.patch | 35 +++++++++++++++++++
 package/pure-ftpd/pure-ftpd.mk                |  3 ++
 2 files changed, 38 insertions(+)
 create mode 100644 package/pure-ftpd/0003-diraliases-always-set-the-tail-of-the-list-to-NULL.patch
package/pure-ftpd/0003-diraliases-always-set-the-tail-of-the-list-to-NULL.patch new file +35 -0
new file mode 100644
index 0000000000..6c58eb74ae
@@ -0,0 +1,35 @@
+From 8d0d42542e2cb7a56d645fbe4d0ef436e38bcefa Mon Sep 17 00:00:00 2001
+From: Frank Denis <[email protected]>
+Date: Tue, 18 Feb 2020 18:36:58 +0100
+Subject: [PATCH] diraliases: always set the tail of the list to NULL
+
+Spotted and reported by Antonio Norales from GitHub Security Labs.
+Thanks!
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Retrieved from:
+https://github.com/jedisct1/pure-ftpd/commit/8d0d42542e2cb7a56d645fbe4d0ef436e38bcefa]
+---
+ src/diraliases.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/diraliases.c b/src/diraliases.c
+index 4002a36..fb70273 100644
+--- a/src/diraliases.c
++++ b/src/diraliases.c
+@@ -93,7 +93,6 @@ int init_aliases(void)
+                 (tail->dir = strdup(dir)) == NULL) {
+                 die_mem();
+             }
+-            tail->next = NULL;
+         } else {
+             DirAlias *curr;
+ 
+@@ -105,6 +104,7 @@ int init_aliases(void)
+             tail->next = curr;
+             tail = curr;
+         }
++        tail->next = NULL;
+     }
+     fclose(fp);
+     aliases_up++;
package/pure-ftpd/pure-ftpd.mk +3 -0
index 0ef9a35250..7b7c7d9637 100644
@@ -17,6 +17,9 @@ PURE_FTPD_IGNORE_CVES += CVE-2019-20176
 # 0002-pure_strcmp-len-s2-can-be-len-s1.patch
 PURE_FTPD_IGNORE_CVES += CVE-2020-9365
 
+# 0003-diraliases-always-set-the-tail-of-the-list-to-NULL.patch
+PURE_FTPD_IGNORE_CVES += CVE-2020-9274
+
 PURE_FTPD_CONF_OPTS = \
 	--with-altlog \
 	--with-puredb
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 package/pure-ftpd: fix CVE-2020-9274

Quoted 7 lines · On Sat, 28 Mar 2020 10:00:42 +0100 Fabrice Fontaine…

An issue was discovered in Pure-FTPd 1.0.49. An uninitialized pointer vulnerability has been detected in the diraliases linked list. When the *lookup_alias(const char alias) or print_aliases(void) function is called, they fail to correctly detect the end of the linked list and try to access a non-existent list member. This is related to init_aliases in diraliases.c.

Quoted 6 lines
---
 ...ays-set-the-tail-of-the-list-to-NULL.patch | 35 +++++++++++++++++++
 package/pure-ftpd/pure-ftpd.mk                |  3 ++
 2 files changed, 38 insertions(+)
 create mode 100644 package/pure-ftpd/0003-diraliases-always-set-the-tail-of-the-list-to-NULL.patch

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/pure-ftpd: fix CVE-2020-9274

In reply to Fabrice Fontaine
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Fabrice" == Fabrice Fontaine <[email protected]> writes:

An issue was discovered in Pure-FTPd 1.0.49. An uninitialized pointer vulnerability has been detected in the diraliases linked list. When the *lookup_alias(const char alias) or print_aliases(void) function is called, they fail to correctly detect the end of the linked list and try to access a non-existent list member. This is related to init_aliases in diraliases.c.

Committed to 2019.02.x, 2019.11.x and 2020.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard