ichinose9372 / ft_transcendense_42

4 stars 1 forks source link

protected against SQL injections #90

Closed snemoto-42 closed 3 months ago

snemoto-42 commented 4 months ago

from Subjects

III.4 Security concerns In order to create a basic functional website, here are a few security concerns that you have to tackle: • Your website must be protected against SQL injections/XSS.

snemoto-42 commented 3 months ago

SQLインジェクション 対策:model.pyなどでdbを操作する場合は、生のSQLではなくDjangoのORMを使用する 確認方法:特殊文字の挿入、ユーザー入力フィールドにシングルクォート(')やセミコロン(;)などの特殊文字を挿入して、SQLクエリが正しくエスケープされているかを確認する ; DELETE FROM transcendence_db

snemoto-42 commented 3 months ago

ユーザー入力後、storeTournamentResultの挙動を元に確認する

snemoto-42 commented 3 months ago

コンテナ内のpsqlにログイン docker exec -it ft_transcendense_42-db-1 bash psql -h db -p 5432 -U user42 -d transcendence_db \dt

トーナメント名に下記を入力 ; delete from models_match;

psqlにてデータベースが消去されていないか確認 select * from models_match;