Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent useragent in httpRequest #12708

Closed
emanuelb opened this issue Nov 16, 2016 · 8 comments
Closed

Inconsistent useragent in httpRequest #12708

emanuelb opened this issue Nov 16, 2016 · 8 comments
Assignees
Labels
enhancement A feature request for improving phpMyAdmin newbie
Milestone

Comments

@emanuelb
Copy link

when curl used to send request:
https://github.com/phpmyadmin/phpmyadmin/blob/master/libraries/Util.php#L4241

        curl_setopt($curl_handle, CURLOPT_USERAGENT, 'phpMyAdmin/' . PMA_VERSION);

The user-agent will contain the PMA version.
but when fopen method is used:
https://github.com/phpmyadmin/phpmyadmin/blob/master/libraries/Util.php#L4865

                'user_agent' => 'phpMyAdmin',

The user-agent will not contain PMA version.

fix:

  1. use the same User-Agent in curl & fopen methods.
  2. include the PMA version in user-agent only if you use it / plan to use it.
@nijel nijel added enhancement A feature request for improving phpMyAdmin newbie labels Nov 16, 2016
@arimourao
Copy link
Contributor

How can I test this?

@ibennetch
Copy link
Member

Further, on quick look the comment at https://github.com/phpmyadmin/phpmyadmin/blob/master/libraries/Util.php#L4848 is incorrect and should reference fopen rather than curl.

@arimourao
Copy link
Contributor

So, should we add PMA on fopen or remove it from curl?

@ForensicITGuy
Copy link

Leaving the PMA version in the user-agent string could help when troubleshooting issues dealing with requests between web servers, but it also presents a security issue. Disclosure of version numbers over a web request in this manner provides unauthenticated users with information that could be used to research a PMA instance for exploits.

@emanuelb
Copy link
Author

Sure, from privacy/security perspective it's better to strip the version in user-agent / or better mock common request pattern (as done by TOR browser)
Still the 'unauthenticated users' in this case are hacked target server & someone conduct successful SSL MITM (as https used in all calls), Thus the question is: does the version information from user-agent will be used (see 2 in fix)

@ervin210
Copy link

hey

@Fenn-CS
Copy link
Contributor

Fenn-CS commented Mar 12, 2017

Hello @emanuelb and @ibennetch I have decided to work on this issue, my proposed solution is to remove all the PMA version occurrences in the header as of now for the purpose of security as mentioned earlier. If this is okay then I will go ahead.

@nijel nijel self-assigned this Mar 14, 2017
nijel added a commit that referenced this issue Mar 14, 2017
Signed-off-by: Michal Čihař <michal@cihar.com>
@nijel nijel added this to the 4.7.0 milestone Mar 14, 2017
@nijel
Copy link
Contributor

nijel commented Mar 14, 2017

Fixed by #13074

@nijel nijel closed this as completed Mar 14, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement A feature request for improving phpMyAdmin newbie
Projects
None yet
Development

No branches or pull requests

7 participants