Repository navigation
Fix #20470: Treat invalid base64 or non UTF-8 Basic auth credentials as absent #21111
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
Open
orcnd
wants to merge
4
commits into
yiisoft:master
Choose a base branch
from
orcnd:fix/20470-invalid-basic-auth
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
041a5d7
Fix #20470: Treat invalid base64 or non UTF-8 Basic auth credentials …
orcnd 41b5bde
Merge branch 'master' into pr/orcnd/21111
terabytesoftw b3840a6
Merge branch 'master' into fix/20470-invalid-basic-auth
mspirkov 818926c
Add test isolating strict base64 decoding of Basic auth credentials
orcnd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: yiisoft/yii2
Length of output: 4471
Script executed:
Repository: yiisoft/yii2
Length of output: 14349
Web query:
PHP HTTP Basic authentication PHP_AUTH_USER PHP_AUTH_PW non UTF-8 bytes base64 decoding source php_handle_auth_dataResult:
Web query:
PHP 8.3 php_handle_auth_data main SAPI.c php_base64_decode auth_user auth_password sourceResult:
Script executed:
Repository: yiisoft/yii2
Length of output: 15809
Script executed:
Repository: yiisoft/yii2
Length of output: 6052
Validate server-provided credentials as UTF-8 too.
When PHP populates
PHP_AUTH_USERorPHP_AUTH_PW, this method returns them before the new check. Non-UTF-8 bytes can therefore reach an authentication callback instead of being treated as absent. Validate both values before the early return.PHPMD (3.0.0)
[warning] 92-2049: The class Request has 1958 lines of code. Current threshold is 1000. Avoid really long classes. (Code Size Rules)
(ExcessiveClassLength)
[warning] 92-2049: The class Request has 84 public methods and attributes. Consider reducing the number of public items to 45 or less. (Code Size Rules)
(ExcessivePublicCount)
[warning] 92-2049: The class Request has 37 fields. Consider redesigning Request to keep the number of fields at 15 or less. (Code Size Rules)
(TooManyFields)
[warning] 92-2049: The class Request has an overall complexity of 286 which is very high. The configured complexity threshold is 50. (Code Size Rules)
(ExcessiveClassComplexity)
[error] 92-2049: The name yii in namespace yii\web is not named in CamelCase. (Controversial Rules)
(CamelCaseNamespace)
[error] 92-2049: The name web in namespace yii\web is not named in CamelCase. (Controversial Rules)
(CamelCaseNamespace)
[error] 92-2049: The property $_cookies is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_headers is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_rawBody is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_bodyParams is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_queryParams is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_hostInfo is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_hostName is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_baseUrl is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_scriptUrl is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_scriptFile is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_pathInfo is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_url is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_ip is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_port is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_securePort is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_contentTypes is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_languages is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_csrfToken is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_secureForwardedHeaderTrustedParts is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[error] 92-2049: The property $_secureForwardedHeaderParts is not named in camelCase. (Controversial Rules)
(CamelCasePropertyName)
[warning] 1391-1429: The method getAuthCredentials() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. (Code Size Rules)
(CyclomaticComplexity)
[error] 1391-1429: getAuthCredentials accesses the super-global variable $_SERVER. (Controversial Rules)
(Superglobals)
[error] 1391-1429: getAuthCredentials accesses the super-global variable $_SERVER. (Controversial Rules)
(Superglobals)
[error] 1391-1429: getAuthCredentials accesses the super-global variable $_SERVER. (Controversial Rules)
(Superglobals)
[error] 1391-1429: getAuthCredentials accesses the super-global variable $_SERVER. (Controversial Rules)
(Superglobals)