Project

General

Profile

Actions

Bug(バグ) #3519

open

管理画面 カテゴリの編集時に csrf_token のバリデーションエラーが発生する場合にホワイトアウトする

Added by Yuya Watanabe about 11 years ago. Updated almost 5 years ago.

Status:
New(新規)
Priority:
Low(低め)
Assignee:
-
Target version:
Start date:
2013-12-09
Due date:
% Done:

0%

Estimated time:
3.6 で発生するか:
Unknown (未調査)
3.8 で発生するか:
Unknown (未調査)

Description

概要

管理画面 カテゴリの編集時に csrf_token のバリデーションエラーが発生する場合にホワイトアウトする.

再現手順

  1. 「管理画面 > コミュニティカテゴリ設定」 を開く( /pc_backend.php/community/categoryList )
  2. 何らかの方法で csrf_token の値を書き換えてそのフォームの「編集」ボタンをクリック
    • 例えば WebDeveloper の「フォーム > 画面内にフォーム情報を表示」で表示された _csrf_token のフォームの値を変更
  3. ホワイトアウトする

dev モードで閲覧すると下記のようなエラーメッセージが表示される.

Fatal error: Call to a member function getMessage() on a non-object in .../apps/pc_backend/modules/community/actions/actions.class.php on line 216 

テストコード実行時

$ php test/functional/pc_backend/communityActionsTest.php 
> Login
# get /
# post /symfony/login
> /community/categoryList - CSRF
# post /community/categoryList
ok 1 - message about CSRF token exists
> /community/categoryEdit/id/1 - CSRF
# post /community/categoryEdit/id/1
not ok 2 - message about CSRF token exists
#     Failed test (./lib/test/opTestFunctional.class.php at line 89)
#            got: false
#       expected: true
> /community/categoryDelete/id/1 - CSRF
# post /community/categoryDelete/id/1
ok 3 - message about CSRF token exists
> /community/addDefaultCommunity/id/1 - CSRF
# post /community/addDefaultCommunity/id/1
not ok 4 - message about CSRF token exists
#     Failed test (./lib/test/opTestFunctional.class.php at line 89)
#            got: false
#       expected: true
> /community/removeDefaultCommunity/id/1 - CSRF
# post /community/removeDefaultCommunity/id/1
ok 5 - message about CSRF token exists
> /community/addAllMember/id/1 - CSRF
# post /community/addAllMember/id/1
ok 6 - message about CSRF token exists
> /community/delete/id/1 - CSRF
# post /community/delete/id/1
ok 7 - message about CSRF token exists
> /community/list - XSS
# get /community/list
ok 8 - all of value of Member.name are escaped.
ok 9 - all of value of Community.name are escaped.
> /community/defaultCommunityList - XSS
# get /community/defaultCommunityList
ok 10 - all of value of Member.name are escaped.
ok 11 - all of value of Community.name2 are escaped.
> /community/addDefaultCommunity/id/1055 - XSS
# get /community/addDefaultCommunity/id/1055
ok 12 - all of value of Member.name are escaped.
ok 13 - all of value of Community.name are escaped.
> /community/removeDefaultCommunity/id/1056 - XSS
# get /community/removeDefaultCommunity/id/1056
ok 14 - all of value of Member.name are escaped.
ok 15 - all of value of Community.name2 are escaped.
> /community/addAllMember/id/1055 - XSS
# get /community/addAllMember/id/1055
ok 16 - all of value of Member.name are escaped.
ok 17 - all of value of Community.name are escaped.
> /community/delete/id/1055 - XSS
# get /community/delete/id/1055
ok 18 - all of value of Member.name are escaped.
ok 19 - all of value of Community.name are escaped.
1..19
# Looks like you failed 2 tests of 19.

原因

#1602 「コミュニティカテゴリを空欄で追加できてしまう」でグローバルエラーに「必須項目です。」のようなエラーを表示作用として name のみを対象とするようになったため,それ以外のエラーメッセージが発生して name にはエラーがない場合にオブジェクトが得られずホワイトアウトする.

修正案

  • 空欄のエラーメッセージをグローバルエラーではなくそれぞれのフォームフィールドでエラーメッセージを表示する
    • この場合、 CommunityCategory モデルから getForm() でフォームが取得されているためバリデーション時の情報がフォームレンダリング時に失われている状態であるのでその修正を行う必要がある
  • すべてのエラーを表示するように変更する
Actions #1

Updated by Yuya Watanabe about 11 years ago

  • Description updated (diff)
Actions #2

Updated by Chiharu Nakajima about 10 years ago

  • Priority changed from Normal(通常) to Low(低め)
Actions #3

Updated by Chiharu Nakajima about 10 years ago

このチケットの内容は下記の項目に該当する不具合であるため、一旦優先度を下げます。
・未対応でもユーザーに影響が少ない不具合(回避可能な不具合である等)

Actions #4

Updated by kaoru n almost 5 years ago

  • Target version set to OpenPNE 3.10.x
Actions

Also available in: Atom PDF