php / php/php-src

PDO\Sqlite::loadExtension loads arbitrary shared objects

オープン
#22,034 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

@SakiTakamachi がすでに取り組んでいます。

2026年5月13日 から。

Bug Extension: pdo_sqlite Status: Needs Triage
主要言語
C
スター
40.4k
フォーク
8.1k
平均マージ
2日 13時間
マージ済み PR(30日)
96

説明

Description

Unlike SQLite3::loadExtension, Pdo\Sqlite::loadExtension does not check sqlite3.extension_dir and calls sqlite3_load_extension with the absolute path to the extension parameter. This allows executing native code from PHP code subject to open_basedir / disable_functions (which are not security boundaries anyway).

https://github.com/php/php-src/blob/769441ba430995733d2ad21727d51b1ace115317/ext/pdo_sqlite/pdo_sqlite.c#L102-L113

I'll open a PR with my patch later this week. It introduces a similar check to SQLite3::loadExtension and restricts extension loading to a trusted directory (sqlite3.extension_dir) set in advance.

PHP Version
PHP 8.6.0-dev (cli) (built: May 10 2026 23:58:07) (NTS)
Copyright © The PHP Group and Contributors
Zend Engine v4.6.0-dev, Copyright © Zend by Perforce
    with Zend OPcache v8.6.0-dev, Copyright ©, by Zend by Perforce
Operating System

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。