Skip to content

NFC-169 Fix PHP auth cert chain, format, SSRF, cookie and OCSP checks#63

Open
SanderKondratjevNortal wants to merge 2 commits into
web-eid-mobilefrom
NFC-169
Open

NFC-169 Fix PHP auth cert chain, format, SSRF, cookie and OCSP checks#63
SanderKondratjevNortal wants to merge 2 commits into
web-eid-mobilefrom
NFC-169

Conversation

@SanderKondratjevNortal

Copy link
Copy Markdown

Signed-off-by: Sander Kondratjev sander.kondratjev@nortal.com

Signed-off-by: Sander Kondratjev <sander.kondratjev@nortal.com>
@SanderKondratjevNortal SanderKondratjevNortal changed the base branch from main to web-eid-mobile June 16, 2026 10:44
Signed-off-by: Sander Kondratjev <sander.kondratjev@nortal.com>
{
return $format !== null &&
str_starts_with($format, self::V1_SUPPORTED_TOKEN_FORMAT_PREFIX);
return $format === self::V1_SUPPORTED_TOKEN_FORMAT_PREFIX ||

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in Java and .NET, minor versions must be backward-compatible within the major version, this will reject future compatible web-eid:1.x tokens. Use the same regex-based approach as in in Java and .NET.

* @throws CertificateDecodingException
* @throws AuthTokenException
*/
public function testSigningCertificateChainValidationFails(): void

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 3 PHPCS errors:

$ ./vendor/bin/phpcs
............................................................  60 / 123 (49%)
E............................E.E............................ 120 / 123 (98%)
...                                                          123 / 123 (100%)



FILE: web-eid/web-eid-authtoken-validation-php/src/validator/certvalidators/SubjectCertificateNotRevokedValidator.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------------------------------------
 59 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line
 60 | ERROR | [x] The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
--------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------


FILE: web-eid/web-eid-authtoken-validation-php/tests/certificate/CertificateValidatorTest.php
--------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------
 38 | ERROR | [x] Opening brace must not be followed by a blank line
--------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------


FILE: web-eid/web-eid-authtoken-validation-php/tests/validator/versionvalidators/AuthTokenVersion11ValidatorTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
 261 | ERROR | [x] Expected 1 space after class keyword; 0 found
-------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------

Time: 415ms; Memory: 10MB


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants