カテゴリー
サイト制作

【WORDPRESS】ログインユーザー名を隠す必要はない(Edit Author Slugは不要)

今回は,ワードプレスに関する小話をお届けします.

それは,『ログインユーザー名を隠すほうが良いの?』という話です.

この図でいうところの,上の欄に入力する文字列ですね.

wordpress user login

ここで少し説明すると…

通常の状態のWordPressでは,サイト内のいろんなページに,管理画面にログインするときに入力する「ユーザー名」が,そのまま見える状態になっています.

仮に,「ユーザー」>「あなたのプロフィール」からブログ上の表示名を変えたとしても,ソースコードには,しっかりとユーザー名が出力されてしまいます.

また,ワードプレスで作成されたサイトURLの末尾に,

/?author=1

とつければ,ログインユーザー名が見れてしまいます.

このようなユーザー名の丸見え問題について,ネット上では,『ユーザー名を隠したほうがよい』という記事がとても多いです.

ユーザー名が分からないほうがセキュリティは向上するというのが理由としてあげられています.

特に,プラグインの導入を推奨する記事が多くあります.

有名なのが,Edit Author Slug(エディットオーサースラッグ)です.

Edit Author Slug(エディットオーサースラッグ)
Edit Author Slug(エディットオーサースラッグ)

ところが,話はそう簡単にうまくいかないようです.

WordPress 4.4 以降では,サイトのURLの末尾に,

/wp-json/wp/v2/users

を付加したアドレスでアクセスすると,表示されたデータの中にユーザー名が含まれてきます.

また,コメント欄のソースコードのclass名からも,ログインユーザー名が分かってしまう場合があります.

なので,Edit Author Slugの導入”のみ”では,完全にユーザー名バレを防ぐことはできません.

ユーザー名をがんばって完璧に隠そうとすると,かなり面倒くさいのです.

ちなみに,このユーザー名の丸見え問題の件については,ワードプレス公式は,こちらで,問題ないと言っています.

強力なパスワードを使うことを奨励しようとしています.

Why are disclosures of usernames or user IDs not a security issue?

The WordPress project doesn’t consider usernames or user ids to be private or secure information. A username is part of your online identity. It is meant to identify, not verify, who you are saying you are. Verification is the job of the password.
Generally speaking, people do not consider usernames to be secret, often sharing them openly. Additionally, many major online establishments — such as Google and Facebook — have done away with usernames in favor of email addresses, which are shared around constantly and freely. WordPress has also moved this way, allowing users to log in with an email address or username since version 4.5.
Instead of attempting to hide a public identifier, WordPress attempts to encourage users to choose strong passwords instead, through both user interface as well as education.
Note that WordPress is not the only open source project to believe this. Drupal has similar arguments for the same thing.

なお,前に,セキュリティ向上のためのログインURLの変更を記事にしましたが,ユーザー名を隠すより.こちらの対策のほうが重要です.

以上,WORDPRESSの小話,「ログインユーザー名を隠す必要はない」でした.