CVE-2019-9928.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. From f672277509705c4034bc92a141eefee4524d15aa Mon Sep 17 00:00:00 2001
  2. From: Tobias Ronge <tobiasr@axis.com>
  3. Date: Thu, 14 Mar 2019 10:12:27 +0100
  4. Subject: [PATCH] gstrtspconnection: Security loophole making heap overflow
  5. The former code allowed an attacker to create a heap overflow by
  6. sending a longer than allowed session id in a response and including a
  7. semicolon to change the maximum length. With this change, the parser
  8. will never go beyond 512 bytes.
  9. Upstream-Status: Backport
  10. CVE: CVE-2019-9928
  11. Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
  12. ---
  13. gst-libs/gst/rtsp/gstrtspconnection.c | 2 +-
  14. 1 file changed, 1 insertion(+), 1 deletion(-)
  15. diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c
  16. index a6755bedd..c0429064a 100644
  17. --- a/gst-libs/gst/rtsp/gstrtspconnection.c
  18. +++ b/gst-libs/gst/rtsp/gstrtspconnection.c
  19. @@ -2461,7 +2461,7 @@ build_next (GstRTSPBuilder * builder, GstRTSPMessage * message,
  20. maxlen = sizeof (conn->session_id) - 1;
  21. /* the sessionid can have attributes marked with ;
  22. * Make sure we strip them */
  23. - for (i = 0; session_id[i] != '\0'; i++) {
  24. + for (i = 0; i < maxlen && session_id[i] != '\0'; i++) {
  25. if (session_id[i] == ';') {
  26. maxlen = i;
  27. /* parse timeout */
  28. --
  29. 2.21.0