Skip to content

fix: avoid crash on hostless LDAP CRL URLs#7523

Merged
vitormattos merged 15 commits intomainfrom
fix/ldap-hostless-crl-url
Apr 21, 2026
Merged

fix: avoid crash on hostless LDAP CRL URLs#7523
vitormattos merged 15 commits intomainfrom
fix/ldap-hostless-crl-url

Conversation

@vitormattos
Copy link
Copy Markdown
Member

@vitormattos vitormattos commented Apr 20, 2026

Summary

  • make LDAP scheme detection resilient when parse_url(..., PHP_URL_SCHEME) does not return a string
  • recognize hostless LDAP URLs (for example ldap:///...) without triggering runtime errors
  • add regression coverage for hostless LDAP CRL URL recognition

Problem

Some certificates expose CRL distribution points using hostless LDAP URLs. In this case, scheme extraction can produce a non-string value and cause a runtime error during LDAP URL detection.

Fix

  • guard the scheme value type before calling strtolower
  • use a safe fallback regex check for ldap:// and ldaps:// patterns when the parsed scheme is not a string

Tests

  • composer test:unit -- --filter LdapCrlDownloaderTest
  • composer test:unit -- --filter CrlRevocationCheckerTest

Notes

This change intentionally keeps CRL validation strict: invalid/inaccessible endpoints return controlled validation statuses instead of crashing the request.

Handle parse_url(PHP_URL_SCHEME) returning non-string values for hostless LDAP URLs such as ldap:///... used by some AD certificate CRL distribution points.\n\nThis prevents a TypeError in scheme detection and adds regression coverage for hostless LDAP URL recognition.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Create a minimal defaultContact.vcf fixture in unit test setup to prevent warning-level failures on Nextcloud master when DAV tries to read the example contact file.\n\nThis keeps phpunit runs stable with --fail-on-warning across DB matrix jobs.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos vitormattos force-pushed the fix/ldap-hostless-crl-url branch from 105a00c to df7ed74 Compare April 20, 2026 13:34
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable33

@vitormattos
Copy link
Copy Markdown
Member Author

/backport to stable32

@vitormattos vitormattos merged commit 9627388 into main Apr 21, 2026
77 checks passed
@vitormattos vitormattos deleted the fix/ldap-hostless-crl-url branch April 21, 2026 14:51
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.

1 participant