Opened 8 years ago

Closed 8 years ago

#1066 closed enhancement (duplicate)

ngx_http_parse: query seperator bug (missing W3C recommended support for semicolon)

Reported by: Darkudorus@… Owned by:
Priority: minor Milestone:
Component: nginx-core Version: 1.11.x
Keywords: http, query, args Cc:
uname -a: /*Ubuntu 16.04 */ Linux <hostname> 4.4.0-36-generic #55-Ubuntu SMP Thu Aug 11 18:01:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: https://launchpad.net/~nginx/+archive/ubuntu/development ###
nginx version: nginx/1.11.3
built with OpenSSL 1.0.2g-fips 1 Mar 2016
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_mp4_module --with-http_perl_module --with-http_random_index_module --with-http_secure_link_module --with-http_v2_module --with-http_sub_module --with-http_xslt_module --with-mail --with-mail_ssl_module --with-stream --with-stream_ssl_module --with-threads --add-module=/build/nginx-arw1Xp/nginx-1.11.3/debian/modules/headers-more-nginx-module --add-module=/build/nginx-arw1Xp/nginx-1.11.3/debian/modules/nginx-auth-pam --add-module=/build/nginx-arw1Xp/nginx-1.11.3/debian/modules/nginx-cache-purge --add-module=/build/nginx-arw1Xp/nginx-1.11.3/debian/modules/nginx-dav-ext-module --add-module=/build/nginx-arw1Xp/nginx-1.11.3/debian/modules/nginx-development-kit --add-module=/build/nginx-arw1Xp/nginx-1.11.3/debian/modules/nginx-echo --add-module=/build/nginx-arw1Xp/nginx-1.11.3/debian/modules/ngx-fancyindex --add-module=/build/nginx-arw1Xp/nginx-1.11.3/debian/modules/nginx-http-push --add-module=/build/nginx-arw1Xp/nginx-1.11.3/debian/modules/nginx-lua --add-module=/build/nginx-arw1Xp/nginx-1.11.3/debian/modules/nginx-upload-progress --add-module=/build/nginx-arw1Xp/nginx-1.11.3/debian/modules/nginx-upstream-fair --add-module=/build/nginx-arw1Xp/nginx-1.11.3/debian/modules/ngx_http_substitutions_filter_module

Description

W3C remommends:
"We recommend that HTTP server implementors, and in particular, CGI implementors support the use of ";" in place of "&" to save authors the trouble of escaping "&" characters in this manner."
https://www.w3.org/TR/html401/appendix/notes.html#h-B.2.2

If i open a file /test.html?token=secretword;expire=300 (; instead of &)
$arg_token will be "secretword;expire=300" and $arg_expire dont exist.

At this time, only ampersand is supported.

But it should be
$arg_token == secretword
and
$arg_expire == 300

Source: https://github.com/nginx/nginx/blob/586ef968f98c379153fea0e7e80119b149380dc8/src/http/ngx_http_parse.c#L2076

In PHP we can also have both:
arg_separator.input = ";&"

nginx should support this correctly, because I want to use Lua.

Thank you! :)

Change History (3)

comment:1 by Maxim Dounin, 8 years ago

Type: defectenhancement

comment:2 by maxim, 8 years ago

Milestone: 1.11.4

Ticket retargeted after milestone closed

comment:3 by Maxim Dounin, 8 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #224.

Note: See TracTickets for help on using tickets.