FCKeditorのセキュリティ
FCKEditorのセキュリティ
LightNeasyに同封されてるFCKEditorには、セキュリティホールが存在します。
▽FCKeditor---------------------------------------------------------
FCKeditorは、'editorfilemanagerconnectors'のコネクトモジュールがユーザ入力を適切にチェックしていないことが原因で任意のファイルをアップロードされるセキュリティホールが存在する。この問題が悪用されると、リモートの攻撃者にシステム上で任意のコードを実行される可能性がある。 [更新]
危険度:
影響を受けるバージョン:FCKeditor 2.6.4以前、GForge 5.6.1、Knowledgeroot Knowledgebase 0.9.9
影響を受ける環境:UNIX、Linux、Windows
回避策:2.6.4.1以降へのバージョンアップ
https://www.netsecurity.ne.jp/6_13649.html
▽LightNEasy--------------------------------------------------------
LightNEasyは、FCKeditorコンポーネントが適切な制限を行っていないことが原因でセキュリティ制限を回避されるセキュリティホールが存在する。この問題が悪用されると、リモートの攻撃者にシステム上で任意のPHPコードを実行される可能性がある。
2009/12/09 登録
危険度:中
影響を受けるバージョン:1.2.2、1.2.2 flat、3.1、2.2.1、2.3
影響を受ける環境:UNIX、Linux、Windows
回避策:公表されていません
https://www.netsecurity.ne.jp/6_14500.html
対策方法
【Step1】 先ずは、FCKeditorのバージョンの確認 (LightNeasy2.2.2、2.3はFCKeditor
2.6.4.1です)
・管理画面よりログインし、ページの編集へ進み Help(?のマーク)をクリック

または
・http://******/fckeditor/editor/dialog/fck_about.html
2.6.4以前の場合は、 2.6.4.1にバージョンアップする。
- 入手先は、例えば、本家の http://www.lightneasy.org/downloads.php のLightNEasy 2.3 no database に含まれる fckeditor は、2.6.4.1 です。
- 現在のFCKeditorの環境ファルを保存。あとで再使用します
/fckeditor/editor/filemanager/connectors/php/config.php
を保存します。 - 一応、バックアップ
設置されてる fckeditor/ ディレクトリ名を変更
http://******/fckeditor/ を http://******/fckeditor_old/ とかに変更 - 1で入手した 2.6.4.1をアップロード
- 2で保存した古い設定ファイル
/fckeditor/editor/filemanager/connectors/php/config.phpを
アップロード(上書き)します・・古い設定となります - 確認。
ここで、管理画面にログインし、ファイルの編集に問題の無い事を確認してください。
特に、画像貼り付けの部分。
サーバーブラウザで既存の画像ファイルが現れるか? 画像がアップできるかなどです

問題がある場合は、3のバックアップに戻してください。
【Step2】セキュリティのFIX(必須)
/fckeditor/editor/filemanager/connectors/php/config.php を修正します。
・$Config['Enabled'] true -> false にします。
・本家以外の派生バージョンは既に false となってる場合もあるようです
// SECURITY: You must explicitly enable this "connector". (Set it to "true").
// WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only
// authenticated users can access this file or use some kind of session checking.
$Config['Enabled'] = true ;
を
// SECURITY: You must explicitly enable this "connector". (Set it to "true").
// WARNING: don't just set "$Config['Enabled'] = true ;", you must be sure that only
// authenticated users can access this file or use some kind of session checking.
//$Config['Enabled'] = true ;
$Config['Enabled']=false;
session_start();
$set=array();
require_once("./../../../../../data/config.php");
if( $_SESSION[$set['password']] == "1" ) $Config['Enabled']=true;
【Step3】LightNEasy2.2.1からの方は下記も修正してください。
// Path to user files relative to the document root.
$sBasePath = $_SERVER['PHP_SELF'] ;
$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "fckeditor" ) ) ;
$Config['UserFilesPath'] = $sBasePath.'images/' ;
を
// Path to user files relative to the document root.
//$sBasePath = $_SERVER['PHP_SELF'] ;
//$sBasePath = substr( $sBasePath, 0, strpos( $sBasePath, "fckeditor" ) ) ;
//$Config['UserFilesPath'] = $sBasePath.'images/' ;
$Config['UserFilesPath'] ='/images/' ;
※ /fckeditor/editor/filemanager/connectors/php/config.php の違いについて。
$Config['UserFilesPath'] の設定・・ここが画像がUPされるディレクトリです。設定によって・・更にimage となる場合もあります。また、画像を貼り付ける際のサーバーブラウザで表示される位置の設定もLightNEasyのバージョンにより微妙に異なります。
- LightNEasy2.2.1の場合:/:/images/
- LightNEasy2.2.2の場合:/userfiles/
- LightNEasy2.3の場合:/images/uploadedimages/
$Config['ChmodOnUpload'] が、LightNEasy2.3 では 0777 となってます。
※こんなの 面倒くさいなー と言う方は 、
/fckeditor の名前を変更して、管理画面で編集する都度、もとに戻す なんてことも(汗
fckeditor/editor/filemanager/connectors/uploadtest.html
fckeditor/editor/filemanager/connectors/test.html の削除





