เขียนโค้ดให้ปลอดภัย
ก็เป็นทักษะอย่างหนึ่งที่ควรรู้
ตัวอย่างเป็นโค้ด 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 number」的推薦目錄:
- 關於php string to number 在 โปรแกรมเมอร์ไทย Thai programmer Facebook 的精選貼文
- 關於php string to number 在 コバにゃんチャンネル Youtube 的精選貼文
- 關於php string to number 在 大象中醫 Youtube 的最佳貼文
- 關於php string to number 在 大象中醫 Youtube 的精選貼文
- 關於php string to number 在 How do I convert a string to a number in PHP? 的評價
- 關於php string to number 在 How to convert a string into number in PHP - YouTube 的評價
- 關於php string to number 在 Array numeric string key gets converted to int · Issue #9029 的評價
- 關於php string to number 在 URI Routing — CodeIgniter 4.4.1 documentation 的評價
php string to number 在 How to convert a string into number in PHP - YouTube 的推薦與評價

In this video, you will learn 4 different ways to convert a string into a number. Our Social Media Links Follow us for Update Facebook ... ... <看更多>
php string to number 在 Array numeric string key gets converted to int · Issue #9029 的推薦與評價
php ?123=foo my script ended with a fatal error stating that argument to that function must be of type string but got int. At first, ... ... <看更多>
php string to number 在 How do I convert a string to a number in PHP? 的推薦與評價
... <看更多>