การตั้งค่า DNS ที่ไม่ปลอดภัย
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หมวดหมู่ OWASP: MASVS-NETWORK: การสื่อสารผ่านเครือข่าย
ภาพรวม
การกำหนดค่า DNS ที่ไม่ปลอดภัยอาจเกิดขึ้นเมื่อนักพัฒนาซอฟต์แวร์ปรับแต่งลักษณะการทำงานของการรับส่ง DNS ของแอปพลิเคชัน
ข้ามค่าเริ่มต้นของอุปกรณ์ หรือเมื่อผู้ใช้ระบุ
เซิร์ฟเวอร์ DNS ส่วนตัวใน Android 9 ขึ้นไป การเบี่ยงเบนจากการกำหนดค่า DNS ที่ดีที่ทราบ
อาจทำให้ผู้ใช้เสี่ยงต่อการโจมตี เช่น การปลอมแปลง DNS หรือการทำลายแคช DNS
ซึ่งจะทำให้นักโจมตีเปลี่ยนเส้นทางการเข้าชมของผู้ใช้ไปยังเว็บไซต์ที่เป็นอันตรายได้
ผลกระทบ
หากผู้โจมตีในเครือข่ายที่เป็นอันตรายสามารถปลอมแปลง DNS ได้ ผู้โจมตีจะเปลี่ยนเส้นทางผู้ใช้ไปยังเว็บไซต์ที่ตนควบคุมได้อย่างแนบเนียน
โดยไม่ทำให้ผู้ใช้เกิดความสงสัย
ตัวอย่างเช่น เว็บไซต์ที่เป็นอันตรายนี้อาจฟิชชิงผู้ใช้เพื่อขอ
ข้อมูลส่วนบุคคลที่ระบุตัวบุคคลนั้นได้ ทำให้เกิดการปฏิเสธการให้บริการสำหรับผู้ใช้ หรือ
เปลี่ยนเส้นทางผู้ใช้ไปยังเว็บไซต์โดยไม่มีการแจ้งเตือน
ความเสี่ยง: ความปลอดภัยในการรับส่งข้อมูล DNS ที่มีช่องโหว่
การกำหนดค่า DNS ที่กำหนดเองอาจอนุญาตให้แอปข้ามการรักษาความปลอดภัยในการรับส่งในตัวของ Android สำหรับ DNS ใน Android 9 ขึ้นไป
การลดปัญหา
ใช้ระบบปฏิบัติการ Android เพื่อจัดการการรับส่งข้อมูล DNS
อนุญาตให้ระบบปฏิบัติการ Android จัดการ DNS ตั้งแต่ SDK ระดับ 28 เป็นต้นมา Android ได้เพิ่ม
ความปลอดภัยในการรับส่ง DNS ผ่าน DNS over TLS และ DNS over HTTP/3 ใน SDK
ระดับ 30
ใช้ SDK ระดับ >=28
อัปเดตระดับ SDK เป็นอย่างน้อย 28 โปรดทราบว่าการลดผลกระทบนี้
ต้องมีการสื่อสารกับเซิร์ฟเวอร์ DNS สาธารณะที่ปลอดภัยและเป็นที่รู้จักกันดี เช่น ที่ระบุไว้ที่นี่
แหล่งข้อมูล
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา Java และ OpenJDK เป็นเครื่องหมายการค้าหรือเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-27 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-27 UTC"],[],[],null,["# Insecure DNS Setup\n\n\u003cbr /\u003e\n\n**OWASP category:** [MASVS-NETWORK: Network Communication](https://mas.owasp.org/MASVS/08-MASVS-NETWORK)\n\nOverview\n--------\n\nInsecure DNS configurations can occur when developers customize an application's\nDNS transport behavior, bypass device defaults, or when a user specifies a\nprivate DNS server in Android 9 and later. Deviation from known good DNS\nconfigurations can leave users vulnerable to attacks like DNS Spoofing or DNS\ncache poisoning, allowing attackers to redirect user traffic to malicious sites.\n\nImpact\n------\n\nIf a malicious network attacker is able to spoof DNS, they can discreetly\nredirect the user to a website they control, without arousing the user's\nsuspicion. This malicious website could, for example, phish the user for\npersonally identifiable information, cause a denial of service for the user, or\nredirect the user to websites without notification.\n\nRisk: Vulnerable DNS Transport Security\n---------------------------------------\n\nCustom DNS configurations may allow apps to bypass Android's built-in transport\nsecurity for DNS in Android 9 and higher.\n\n### Mitigations\n\n#### Use the Android OS to handle DNS traffic\n\nAllow the Android OS to handle DNS. Since SDK level 28, Android has added\nsecurity to DNS transport through DNS over TLS, and then DNS over HTTP/3 in SDK\nlevel 30.\n\n#### Use SDK level \\\u003e=28\n\nUpdate SDK level to at least 28. It should be noted that this mitigation\nrequires communication with well-known and secure public DNS servers such as can\nbe found [here](https://dnsprivacy.org/public_resolvers/).\n\nResources\n---------\n\n- [Resolve DNS queries](/training/basics/network-ops/connecting#lookup-dns)\n- [Java reference for DnsResolver Class](/reference/android/net/DnsResolver)\n- [Android Security Blog post about DNS-over-HTTP/3](https://security.googleblog.com/2022/07/dns-over-http3-in-android.html)\n- [Overview of secure transport for DNS](https://developers.google.com/speed/public-dns/docs/secure-transports)\n- [Android Developer Blog post about DNS over TLS](https://android-developers.googleblog.com/2018/04/dns-over-tls-support-in-android-p.html)"]]