เขียนโค้ดให้ปลอดภัย
ก็เป็นทักษะอย่างหนึ่งที่ควรรู้
ตัวอย่างเป็นโค้ด PHP
.
ให้คิดว่าตัวแปร $value มีค่าเป็นสตริง
ข้างในอยู่ในรูปแบบตัวเลข
เช่น เอาไว้ใช่เก็บพวกเลข session id หรือ token อะไรก้ได้
.
แล้วสมมติว่า $value
มันดันรับค่าเป็น '0e......' (ตามด้วยตัวเลข)
เช่น
$value = '0e125996890409996004'
.
แบบนี้ถ้าใช่การเปรียบเทียบ
ในนิพจน์ของประโยคเปรียบเทียบ
ใช้โดยไม่ระวังตัวแล้วละก็
.
ก็อาจเกิดช่องโหว่
ถ้าเบาๆ หน่อยก็เป็น bug นิดหน่อย
.
แต่ถ้าร้ายแรง ก็จะกลายเป็นช่องโหว่ความปลอดภัยได้ด้วย
ยิ่งในเงื่อนไข
มันเอาไว้เช็คพวกสิทธิต่างๆ ด้วยแล้วละก็
ถ้าเช็คพลาด หลุดไปได้
ก็จะเข้าถึงสิ่งที่ไม่ควรเข้าถึงได้
แบบนี้ hacker นั่งยิ้มเลย
.
✍ เขียนโดย โปรแกรมเมอร์ไทย thai programmer
Write the code safely.
It's one skill to know.
Example is a PHP code
.
To think that $value variant is worth a string.
Inside is in number form.
For example, keep those session id or token numbers.
.
And assume $value
It accepts value as '0 e......' (followed by numbers)
For example,
$value = '0e125996890409996004'
.
This is if it's a comparison.
In the litigation of comparison sentences
Use it without being careful.
.
Maybe a loophole.
If it's a little bit of a bug.
.
But if it's deadly, it can also be a safety loophole.
The more in terms.
It's for checking the rights too.
If you miss it, you can slip it.
It's gonna reach the unaccountable
This is a hacker sitting and smiling.
.
✍ Written by Thai programmer thai coderTranslated
同時也有10000部Youtube影片,追蹤數超過2,910的網紅コバにゃんチャンネル,也在其Youtube影片中提到,...
「php string to value」的推薦目錄:
- 關於php string to value 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的最佳貼文
- 關於php string to value 在 コバにゃんチャンネル Youtube 的精選貼文
- 關於php string to value 在 大象中醫 Youtube 的最佳貼文
- 關於php string to value 在 大象中醫 Youtube 的最佳解答
- 關於php string to value 在 How do I convert a string to a number in PHP? - Stack Overflow 的評價
- 關於php string to value 在 PHP set empty string values (from Jeffrey Way) - gists · GitHub 的評價
- 關於php string to value 在 PHP Tutorial (1) Strings, Variables, Echo, Arrays - YouTube 的評價
php string to value 在 コバにゃんチャンネル Youtube 的精選貼文
php string to value 在 大象中醫 Youtube 的最佳貼文
php string to value 在 大象中醫 Youtube 的最佳解答
php string to value 在 PHP set empty string values (from Jeffrey Way) - gists · GitHub 的推薦與評價
PHP set empty string values (from Jeffrey Way). Raw. Set Value.md. You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:. ... <看更多>
php string to value 在 PHP Tutorial (1) Strings, Variables, Echo, Arrays - YouTube 的推薦與評價
PHP Tutorial for beginners, this is an overview on String, Varibles, Echo, Arrays, and a tiny bit of POST. It is ... ... <看更多>
php string to value 在 How do I convert a string to a number in PHP? - Stack Overflow 的推薦與評價
... <看更多>
相關內容