<center>  </center> こんにちは、 @shogoです。 WEBアプリケーションを開発していて、気になるのがSecurityです。 Steemアプリケーション開発においては、XSS攻撃を頭に入れておいた方がよいかもしれません。 <center>  </center> Steemブロックチェーンから投稿を取得して、動的にHTMLを生成する場合、Sanitize (HTMLタグを限定する)してあげた方が良いです。 marked.jsを利用している場合は、以下のような感じでサニタイズすることができます。 ``` marked(result.body, {sanitize: true}) ``` <br> しかし、この方法だと記事の表示に必要なタグも禁止されてしまう場合があるので、新たにコードを追加します。 簡単なのは、以下のようなライブラリを使うことですね。 https://github.com/punkave/sanitize-html --- Steemit.comの記事表示では、scriptタグは表示されないようになっていました。 しかしjavascriptコードを埋め込む方法は色々あるので、最低限の対策は必要そうです。 間違っている点がございましたら、教えて頂けると嬉しいです! 
author | shogo | ||||||
---|---|---|---|---|---|---|---|
permlink | prevent-cross-site-scripting-xss | ||||||
category | jp-dev | ||||||
json_metadata | {"community":"busy","app":"steemit/0.1","format":"markdown","tags":["jp-dev","japanese","busy","steem","jjm"],"users":["shogo"],"links":["https://github.com/punkave/sanitize-html"],"image":["https://cdn.steemitimages.com/DQmV2AV3tBtjBrmYDB33d18ZCLFp9PQ7TDAKn117fEG3jDV/Cross%20site%20scripting.png","https://cdn.steemitimages.com/DQmRvq2qkSy5QqCLYCzHpS3M1FPE1Ai6pLXM1c2MTzW8y2V/%E3%83%97%E3%83%AC%E3%82%BC%E3%83%B3%E3%83%86%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B31.png","https://cdn.steemitimages.com/DQmfT1ff4qcYsU6XBguqfYVryQZBFJRLwX3giwtWbQv9r9t/steemgif.gif"]} | ||||||
created | 2019-03-30 14:06:39 | ||||||
last_update | 2019-03-30 14:41:03 | ||||||
depth | 0 | ||||||
children | 4 | ||||||
last_payout | 2019-04-06 14:06:39 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 2.547 HBD | ||||||
curator_payout_value | 0.645 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 997 | ||||||
author_reputation | 63,776,063,283,749 | ||||||
root_title | "Prevent Cross Site Scripting (XSS)" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 82,202,518 | ||||||
net_rshares | 5,170,902,347,814 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
yoshiko | 0 | 764,878,929,484 | 100% | ||
fukako | 0 | 1,661,391,916 | 100% | ||
busy.pay | 0 | 428,122,827,002 | 2.09% | ||
redes | 0 | 955,712,634,556 | 18% | ||
ramengirl | 0 | 102,021,284,075 | 100% | ||
danielsaori | 0 | 53,940,248,199 | 100% | ||
rt395 | 0 | 8,732,141,172 | 40% | ||
kinakomochi | 0 | 100,275,465,733 | 50% | ||
djynn | 0 | 44,500,325,208 | 40% | ||
virus707 | 0 | 126,749,541,742 | 1% | ||
kayoko | 0 | 44,439,955,317 | 60% | ||
kuroneko | 0 | 43,393,192,938 | 100% | ||
karencarrens | 0 | 15,414,637,464 | 50% | ||
travelgirl | 0 | 70,377,866,273 | 35% | ||
steemitjp | 0 | 515,773,635,550 | 100% | ||
ichigo | 0 | 16,317,030,531 | 100% | ||
yasu24 | 0 | 19,755,957,849 | 15% | ||
moromaro | 0 | 60,630,031,016 | 50% | ||
tonpa | 0 | 9,645,777,188 | 30% | ||
shogo | 0 | 105,797,016,791 | 100% | ||
childcare | 0 | 35,794,936,065 | 50% | ||
argon | 0 | 115,248,873,212 | 30% | ||
neoconqueso | 0 | 14,325,091,490 | 100% | ||
ace69 | 0 | 2,346,263,744 | 50% | ||
youko | 0 | 2,697,884,906 | 100% | ||
sho-t | 0 | 8,163,348,183 | 20% | ||
jrvacation | 0 | 49,429,404,091 | 30% | ||
fun2learn | 0 | 849,993,645 | 1.8% | ||
jsj1215 | 0 | 66,025,065,646 | 20% | ||
yasu | 0 | 77,185,536,825 | 25% | ||
hilty | 0 | 2,557,214,393 | 100% | ||
steemitbae | 0 | 31,137,137,719 | 100% | ||
tinkerbell-luv | 0 | 2,084,820,908 | 100% | ||
sallyfun | 0 | 15,842,152,168 | 40% | ||
yo-yo | 0 | 9,435,168,768 | 10% | ||
camillesteemer | 0 | 0 | -100% | ||
aki-kuraoka | 0 | 449,707,780 | 100% | ||
izzy7 | 0 | 127,484,309 | 100% | ||
nailyourhome | 0 | 761,591,498 | 1.8% | ||
takezou | 0 | 2,714,338,500 | 15% | ||
hiroharry | 0 | 460,459,628 | 100% | ||
chihaha | 0 | 626,391,415 | 100% | ||
delegate4upvot | 0 | 841,311,991 | 1.8% | ||
fujisan | 0 | 13,643,701,360 | 100% | ||
brian111 | 0 | 221,906,324 | 100% | ||
ryuhei | 0 | 1,863,753,402 | 100% | ||
eita | 0 | 12,645,909,645 | 100% | ||
yusaku | 0 | 13,371,013,543 | 100% | ||
glastar | 0 | 37,579,532,876 | 10% | ||
tamito0201 | 0 | 485,140,790,939 | 50% | ||
jp-tiger | 0 | 64,235,243,115 | 100% | ||
anmitsu | 0 | 313,805,628,768 | 100% | ||
knozaki2016 | 0 | 242,636,041,966 | 100% | ||
atom-jp | 0 | 39,375,359,838 | 100% | ||
realgoodcontent | 0 | 222,856,467 | 25.9% | ||
shogo.life | 0 | 186,849,475 | 100% | ||
j-car | 0 | 18,729,693,208 | 10% |
!sneeze 花粉症とか防げたらいいですね
author | anmitsu |
---|---|
permlink | re-shogo-prevent-cross-site-scripting-xss-20190401t101752769z |
category | jp-dev |
json_metadata | {"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["jp-dev"],"users":[],"links":[],"image":[]} |
created | 2019-04-01 10:17:54 |
last_update | 2019-04-01 10:17:54 |
depth | 1 |
children | 2 |
last_payout | 2019-04-08 10:17:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 22 |
author_reputation | 4,043,053,357,511 |
root_title | "Prevent Cross Site Scripting (XSS)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 82,299,101 |
net_rshares | 0 |
花粉症はかなり辛いので防ぎたいですね :DD @anmitsuさんは、花粉症ですか?? !SSS
author | shogo |
---|---|
permlink | re-anmitsu-re-shogo-prevent-cross-site-scripting-xss-20190402t032716520z |
category | jp-dev |
json_metadata | {"tags":["jp-dev"],"users":["anmitsu"],"app":"steemit/0.1"} |
created | 2019-04-02 03:27:18 |
last_update | 2019-04-02 03:27:18 |
depth | 2 |
children | 1 |
last_payout | 2019-04-09 03:27:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 48 |
author_reputation | 63,776,063,283,749 |
root_title | "Prevent Cross Site Scripting (XSS)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 82,344,678 |
net_rshares | 0 |
Dear anmitsu, The SSS is on its way!
author | shogo.life |
---|---|
permlink | re-re-anmitsu-re-shogo-prevent-cross-site-scripting-xss-20190402t032716520z-20190402t032733z |
category | jp-dev |
json_metadata | "{"app": "beem/0.20.19"}" |
created | 2019-04-02 03:27:39 |
last_update | 2019-04-02 03:27:39 |
depth | 3 |
children | 0 |
last_payout | 2019-04-09 03:27:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 36 |
author_reputation | 6,302,148,905 |
root_title | "Prevent Cross Site Scripting (XSS)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 82,344,703 |
net_rshares | 0 |
You have been infected by the [***King of Disease!***](https://steempeak.com/@king-of-disease/beware-the-steem-plague-is-here) Will you quarantine yourself? Or will you spread the plague? <center></center>
author | king-of-disease |
---|---|
permlink | king-of-disease-1554113878688 |
category | jp-dev |
json_metadata | {"app":"king-of-disease/1.33.7","format":"markdown","tags":["king-of-disease"]} |
created | 2019-04-01 10:17:57 |
last_update | 2019-04-01 10:17:57 |
depth | 1 |
children | 0 |
last_payout | 2019-04-08 10:17:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 277 |
author_reputation | 735,236,958,306 |
root_title | "Prevent Cross Site Scripting (XSS)" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 82,299,103 |
net_rshares | 0 |