Opened 5 years ago

Closed 5 years ago

#7871 closed defect (fixed)

URLs with @ in path parse incorrectly

Reported by: sfan5 Owned by:
Priority: important Component: avformat
Version: git-master Keywords: http regression
Cc: barsnick@gmx.net, Marton Balint, tempel.julian@gmail.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

When parsing URLs that contain an @ in the path, segments of the path end up being "eaten" as they are considered part of userinfo.

How to reproduce:

% ffprobe 'https://1liveuni-lh.akamaihd.net/i/1LIVE_HDS@179577/master.m3u8'
ffprobe version N-93683-g163bb087f8 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 8.3.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --enable-pic --enable-shared --enable-avresample --enable-gpl --enable-nonfree --enable-libass --enable-libbluray --enable-libcdio --enable-libfdk-aac --enable-fontconfig --enable-libfreetype --enable-libmp3lame --enable-nvenc --enable-openssl --enable-libopus --enable-libpulse --enable-libvorbis --enable-vdpau --disable-vaapi --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libzimg
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 52.100 / 58. 52.100
  libavformat    58. 27.103 / 58. 27.103
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 50.100 /  7. 50.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[tcp @ 0x55846e2a5cc0] Connection to tcp://179577:443 failed: Invalid argument
https://1liveuni-lh.akamaihd.net/i/1LIVE_HDS@179577/master.m3u8: Invalid argument

Here, FFmpeg ends up trying to open "https://179577/master.m3u8" with the username "1liveuni-lh.akamaihd.net/i/1LIVE_HDS", which is obviously incorrect.

Further notes:
This issue exists since commit dd06f022b07438d650c82255dff16908ba04244a, which was supposed to fix ticket #7816

According to the specification https://tools.ietf.org/html/std66#appendix-A

  • the "userinfo" part of an URI is not allowed to contain a slash (as implemented by the commit above)
  • the "path" part of an URI may contain a literal @ so URLs like the one above are within the spec

Change History (6)

comment:1 by Carl Eugen Hoyos, 5 years ago

Keywords: http regression added
Priority: normalimportant

comment:2 by barsnick, 5 years ago

Cc: barsnick@gmx.net added

comment:3 by Marton Balint, 5 years ago

Cc: Marton Balint added

Hmm, this seems like a bigger issue than the one which was fixed. So maybe the patch causing the regression should simply be reverted?

comment:4 by aufkrawall, 5 years ago

Cc: tempel.julian@gmail.com added

comment:5 by Kyle, 5 years ago

Any update on reverting that patch? This is breaking many Akamai HLS streams since their stream api uses @ to identify the stream_id in their urls.

comment:6 by Marton Balint, 5 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.