Skip to main content
Sign in
Snippets Groups Projects

Commits · 8feefc281f03c0f1af3422a8f0febb68edb145f2

  1. Sep 06, 2022
  2. Sep 02, 2022
  3. Sep 01, 2022
  4. Jul 27, 2022
  5. Jul 14, 2022
  6. Jul 01, 2022
  7. Jun 22, 2022
  8. May 23, 2022
  9. May 10, 2022
  10. May 06, 2022
  11. Apr 04, 2022
  12. Mar 29, 2022
  13. Mar 28, 2022
  14. Mar 16, 2022
  15. Mar 15, 2022
  16. Mar 14, 2022
  17. Mar 13, 2022
  18. Mar 07, 2022
  19. Feb 25, 2022
  20. Feb 23, 2022
  21. Feb 21, 2022
  22. Feb 21, 2022
  23. Jan 02, 2022
  24. Sep 04, 2021
  25. Aug 31, 2021
  26. Aug 30, 2021
    • Miss Islington (bot)'s avatar
    • Miss Islington (bot)'s avatar
      bpo-45001: Make email date parsing more robust against malformed input (GH-27946) (GH-27975) · e9b85afd
      Miss Islington (bot) authored
      
      Various date parsing utilities in the email module, such as
      email.utils.parsedate(), are supposed to gracefully handle invalid
      input, typically by raising an appropriate exception or by returning
      None.
      
      The internal email._parseaddr._parsedate_tz() helper used by some of
      these date parsing routines tries to be robust against malformed input,
      but unfortunately it can still crash ungracefully when a non-empty but
      whitespace-only input is passed. This manifests as an unexpected
      IndexError.
      
      In practice, this can happen when parsing an email with only a newline
      inside a ‘Date:’ header, which unfortunately happens occasionally in the
      real world.
      
      Here's a minimal example:
      
          $ python
          Python 3.9.6 (default, Jun 30 2021, 10:22:16)
          [GCC 11.1.0] on linux
          Type "help", "copyright", "credits" or "license" for more information.
          >>> import email.utils
          >>> email.utils.parsedate('foo')
          >>> email.utils.parsedate(' ')
          Traceback (most recent call last):
            File "<stdin>", line 1, in <module>
            File "/usr/lib/python3.9/email/_parseaddr.py", line 176, in parsedate
              t = parsedate_tz(data)
            File "/usr/lib/python3.9/email/_parseaddr.py", line 50, in parsedate_tz
              res = _parsedate_tz(data)
            File "/usr/lib/python3.9/email/_parseaddr.py", line 72, in _parsedate_tz
              if data[0].endswith(',') or data[0].lower() in _daynames:
          IndexError: list index out of range
      
      The fix is rather straight-forward: guard against empty lists, after
      splitting on whitespace, but before accessing the first element.
      (cherry picked from commit 989f6a38)
      
      Co-authored-by: default avatarwouter bolsterlee <wouter@bolsterl.ee>
      Unverified
      e9b85afd
  27. Jul 05, 2021
  28. Jun 28, 2021
  29. Jun 03, 2021
  30. May 20, 2021
  31. May 07, 2021
  32. May 06, 2021
  33. May 04, 2021
  34. May 03, 2021
  35. Mar 29, 2021
  36. Mar 16, 2021
    • Miss Islington (bot)'s avatar
      [3.7] bpo-43285 Make ftplib not trust the PASV response. (GH-24838) (GH-24881) (GH-24883) · 79373951
      Miss Islington (bot) authored
      
      The IPv4 address value returned from the server in response to the PASV command
      should not be trusted.  This prevents a malicious FTP server from using the
      response to probe IPv4 address and port combinations on the client network.
      
      Instead of using the returned address, we use the IP address we're
      already connected to.  This is the strategy other ftp clients adopted,
      and matches the only strategy available for the modern IPv6 EPSV command
      where the server response must return a port number and nothing else.
      
      For the rare user who _wants_ this ugly behavior, set a `trust_server_pasv_ipv4_address`
      attribute on your `ftplib.FTP` instance to True..
      (cherry picked from commit 0ab152c6)
      
      Co-authored-by: default avatarGregory P. Smith <greg@krypto.org>
      (cherry picked from commit 664d1d16)
      Unverified
      79373951
  37. Mar 03, 2021
  38. Feb 26, 2021
  39. Feb 16, 2021
  40. Feb 15, 2021
  41. Jan 18, 2021
  42. Jan 01, 2021
  43. Dec 18, 2020
  44. Dec 01, 2020
  45. Nov 22, 2020
  46. Nov 18, 2020
  47. Nov 10, 2020
  48. Oct 22, 2020
  49. Oct 20, 2020
  50. Oct 08, 2020
  51. Aug 17, 2020
Loading