php / php/php-src

mysqli::real_connect(): Authentication data too long. Won't fit into the buffer and will be truncated. Authentication will thus fail

Open
#10,800 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Extension: mysqlnd Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

I'm using JWT tokens as passwords for MariaDB (via PAM auth) and while using phpmyadmin 5.2.1 I see this message pop up. However, even though the message appears authentication does succeed.

It looks like mysqlnd_wireprotocol.c will set this message if (packet->auth_data_len > 0xFF)

Passwords can actually be extremely long though.

PHP Version

PHP 8.1.15

Operating System

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The warning is emitted in mysqlnd_wireprotocol.c when packet->auth_data_len exceeds 0xFF. Start there and trace how authentication data length is encoded and handled for MariaDB/PAM credentials. Done means the behavior and warning accurately reflect authentication with long credentials, with coverage for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, mariadb, php
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.