mabots' blog

知のレバレッジを最大化せよ (旧はてなダイアリーから移転しました。)

Myspace のアカウント流出は 2013年6月11日以前のものはリスクに晒されているらしい

Myspace のアカウント流出は報道だと「一部の」という内容でしたが、結局範囲としては2013年6月11日以前のものはリスクに晒されているらしい。

つまり、Time に買収される前に Myspace 利用経験があった方のほとんどすべてがリスクに晒されている、ということです。

下記のメールが Myspace から送信されており、まとめると、

影響範囲

対象時期
  • 2013年6月11日以前に旧プラットフォームで作成されたアカウント
流出した内容
  • Myspace のユーザ ID
  • Myspace のパスワード
  • E メールアドレス

メール内容の転載

Notice of Data Breach

You may have heard reports recently about a security incident involving Myspace. We would like to make sure you have the facts about what happened, what information was involved and the steps we are taking to protect your information.


What Happened?

Shortly before the Memorial Day weekend (late May 2016), we became aware that stolen Myspace user login data was being made available in an online hacker forum. The data stolen included user login data from a portion of accounts that were created prior to June 11, 2013 on the old Myspace platform.

We believe the data breach is attributed to Russian Cyberhacker ‘Peace.’ This same individual is responsible for other recent criminal attacks such as those on LinkedIn and Tumblr, and has claimed on the paid hacker search engine LeakedSource that the data is from a past breach. This is an ongoing investigation, and we will share more information as it becomes available.


What Information Was Involved?

Email addresses, Myspace usernames, and Myspace passwords for the affected Myspace accounts created prior to June 11, 2013 on the old Myspace platform are at risk. As you know, Myspace does not collect, use or store any credit card information or user financial information of any kind. No user financial information was therefore involved in this incident; the only information exposed was users’ email address and Myspace username and password.


What We Are Doing

In order to protect our users, we have invalidated all user passwords for the affected accounts created prior to June 11, 2013 on the old Myspace platform. These users returning to Myspace will be prompted to authenticate their account and to reset their password by following instructions at https://myspace.com/forgotpassword

Myspace is also using automated tools to attempt to identify and block any suspicious activity that might occur on Myspace accounts.

We have also reported the incident to law enforcement authorities and are cooperating to investigate and pursue this criminal act. As part of the major site re-launch in the summer of 2013, Myspace took significant steps to strengthen account security. The compromised data is related to the period before those measures were implemented. We are currently utilizing advanced protocols including double salted hashes (random data that is used as an additional input to a one-way function that "hashes" a password or passphrase) to store passwords. Myspace has taken additional security steps in light of the recent report.


What You Can Do

We have several dedicated teams working diligently to ensure that the information our members entrust to Myspace remains secure. Importantly, if you use passwords that are the same or similar to your Myspace password on other online services, we recommend you set new passwords on those accounts immediately.


For More Information

If you have any questions, please feel free to contact our Data Security & Protection team at dsp_help@myspace-inc.com or visit our blog at https://myspace.com/pages/blog.

HTTPS のページではてなブックマーク ブックマークレットが動作しない時の対処法

Chromeはてなブックマークレットを使っている時に HTTPS のページだとブックマークに反応してくれないのでちょっとしたストレスを長年抱えていました。Chrome 拡張をいれれば解決されますが、Chrome を汚したくない、という場合は http://b.hatena.ne.jp/register の「上記のブックマークレットが動作しない、または旧バージョンのようなブックマークレットを使いたい場合」を利用すると HTTPS のページでもブックマークできます。
デメリットとしては、ページ遷移してしまうので、今見ているページが動的にページ構築していて URL 遷移対応していない場合にそのページのコンテキストが失われてしまいます。Workaround として私は HTTPS 用とそれ以外の2つのブックマークレットを併用しています。


2016/05/27 追記

デメリットであるページ遷移についても id:noromanba さんの 「タブで開く版」 を利用すると回避できます。(コメントを参照ください。)
ブックマークレットを右クリックで「編集」し、下記ダイアログのURL を書き換えます。

https://gist.github.com/noromanba/de465f65a50b171322431fadee4ce034

javascript:window.open(`http://b.hatena.ne.jp/my/add.confirm?url=${location.href}&title=${document.title}`,'_blank');

自分以外の領域がクリックされたら、ポップアップを閉じるような jQuery の処理例。

ポップアップを表示して、その領域外をクリックされた時にそのポップアップを閉じたい、といった処理はよくあります。
Stackoverflow などでよくある処理としては、

  • クリックイベントを全検知して、Pop up を閉じるような処理をしてしまう。
  • もし自分自身だったら stopPropagation() して、イベント伝播しなくする。

という処理があるのですが、若干危険な処理です。理由は後述します。

今回のアプローチとしては

  • クリックイベントを全検知 (ついでに touch device も対応)
  • もし、そのクリックが自分を含まないものであれば *1 閉じる処理をする。
$(document).on('click touchend', function(event) {
  if (!$(event.target).closest('#target').length) {
    // ここに処理;
  }
});

なぜ安易に stopPropagation() するべきではないのか

  • stopPropagation() すると、他の DOM に click が伝播しなくなります。
    • 他の DOM でも click event を検知する必要があるものがあるかもしれません。
      • ポップアップやモーダルが開かれている時にこれらの動作に問題はないのでしょうか
  • stopPropagation() は global に影響する処理なので、一箇所これがあるだけでコードの保守性が大幅に下がってしまう。

詳しくは https://css-tricks.com/dangers-stopping-event-propagation/

カレントの作業ブランチ名をいちいち指定せずに git push する方法

現在の local の branch が feature/hoge だとして、リモートの同名 branch に push する時は

git push origin feature/hoge

としますが、いちいちブランチ名を指定しなくとも

git push origin HEAD

とすれば、現在のブランチを push してくれます。よく実施する操作なので、覚えておくと便利ですね。

参考

git push origin HEAD
A handy way to push the current branch to the same name on the remote.

注意事項

他にも引数なしの git push 時の default の挙動を変える方法もありますが、何が起こっているのか把握した上で実施されたほうが良いかと思います。*1

*1:バージョンによって挙動が違うが、たとえば http://dqn.sakusakutto.jp/2012/10/git_push.html

bundle 実行が遅い時などに rubygems.org のミラーを使う

bundle install 自体がネットワークエラーで失敗したり、あるいは経過が遅い時、本家のネットワーク応答が悪い時があるようです。

Gemfile

下記編集して、bundle install 実行します。

-  remote: https://rubygems.org/
+  remote: http://production.cf.rubygems.org/