php / php/php-src

ldap timeouts not enforced for ldaps protocol

未关闭
#9,320 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Bug Extension: ldap Status: Needs Triage
主要语言
C
星标
40.4k
派生
8.1k
平均合并
2 天 13 小时
30 天内合并 PR
96

描述

Description

According to site: https://bugs.php.net/bug.php?id=69574
I added LDAP_OPT_TIMEOUT to enforce bind operation time out. This worked for ldap protocol. But not for ldaps protocol.
steps to reproduce:

In one ssh session, I am running the following command to simulate a socket listener:
nc -l 636

And run following code:

<?php
$ldap = ldap_connect('ldaps://127.0.0.1:636');

ldap_set_option($ldap, LDAP_OPT_NETWORK_TIMEOUT, 3);
ldap_set_option($ldap, LDAP_OPT_TIMELIMIT, 3);
ldap_set_option($ldap, LDAP_OPT_TIMEOUT, 3);

ldap_bind($ldap);
?>

Resulted in this output:

This never times out

But I expected this output instead:

times out in 3 seconds. 
PHP Version

PHP 7.4.30

Operating System

Windows 10

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,使用 nc 监听器运行所提供的 PHP 脚本,并重点关注 ldaps 协议的 ldap_connect、ldap_set_option 和 ldap_bind 入口点。跟踪 LDAP_OPT_NETWORK_TIMEOUT、LDAP_OPT_TIMELIMIT 和 LDAP_OPT_TIMEOUT 的应用方式,然后验证 bind 是否在大约 3 秒后以 timeout 结束。

由索引模型根据 Issue 内容生成。

评估

技术栈
c, php
领域
authentication, networking
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。