7.5 Apache HttpClient
The most widely used version of Apache HttpClient is 3.1, released in 2007. This library, as well as its earlier versions, sets
up SSL connections using JSSE’s SSLSocketFactory without performing its own hostname verification (see Sections 4.1 and 4.2).
As a consequence, Apache HttpClient 3.* accepts any certificate
with a valid chain of trust, regardless of the name. As mentioned in
Section 4.2, the same bug occurs in Weberknecht.
The hostname verification bug in HttpClient was fixed in version
4.0-alpha1 [1]. The current version, 4.2.1, has its own hostname
verifier and delegates chain-of-trust verification to JSSE. Unfortunately, as we show in Section 8, the existence of a correct implementation of HttpClient has had little effect on the security of applications that rely on HttpClient for SSL connection establishment.
Apache HttpClient 4.* involved a major architectural re-design,
thus much of legacy and even new software still relies on version
3.*. The use of HttpClient is often hidden inside Web-services middleware such as Axis 2 and XFire, which—several years after version 4.* became available—still ship with HttpClient 3.* and thus
skip hostname verification for SSL certificates.
It is worth noting that the custom hostname verification code
added to HttpClient 4.* is incorrect and will reject valid certificates.
The following code is from HttpClient 4.2.1:
This code computes the length of the prefix by subtracting 2
from the number of parts (determined by the number of dots in the
name). This logic is incorrect: validity of the first part of a domain
name should have nothing to do with the total number of parts.
Forexample, it will reject mail...com if the name in the
certificate is m*...com.
Furthermore, the original patch, as well as its derivatives, has
a minor bug in the regular expression for parsing IPv4 addresses,
causing it to accept IP addresses starting with zero (this does not
immediately result in a security vulnerability):
7.5 Apache HttpClient
The most widely used version of Apache HttpClient is 3.1, released in 2007. This library, as well as its earlier versions, sets
up SSL connections using JSSE’s SSLSocketFactory without performing its own hostname verification (see Sections 4.1 and 4.2).
As a consequence, Apache HttpClient 3.* accepts any certificate
with a valid chain of trust, regardless of the name. As mentioned in
Section 4.2, the same bug occurs in Weberknecht.
The hostname verification bug in HttpClient was fixed in version
4.0-alpha1 [1]. The current version, 4.2.1, has its own hostname
verifier and delegates chain-of-trust verification to JSSE. Unfortunately, as we show in Section 8, the existence of a correct implementation of HttpClient has had little effect on the security of applications that rely on HttpClient for SSL connection establishment.
Apache HttpClient 4.* involved a major architectural re-design,
thus much of legacy and even new software still relies on version
3.*. The use of HttpClient is often hidden inside Web-services middleware such as Axis 2 and XFire, which—several years after version 4.* became available—still ship with HttpClient 3.* and thus
skip hostname verification for SSL certificates.
It is worth noting that the custom hostname verification code
added to HttpClient 4.* is incorrect and will reject valid certificates.
The following code is from HttpClient 4.2.1:
This code computes the length of the prefix by subtracting 2
from the number of parts (determined by the number of dots in the
name). This logic is incorrect: validity of the first part of a domain
name should have nothing to do with the total number of parts.
Forexample, it will reject mail...com if the name in the
certificate is m*...com.
Furthermore, the original patch, as well as its derivatives, has
a minor bug in the regular expression for parsing IPv4 addresses,
causing it to accept IP addresses starting with zero (this does not
immediately result in a security vulnerability):
การแปล กรุณารอสักครู่..
![](//thimg.ilovetranslation.com/pic/loading_3.gif?v=b9814dd30c1d7c59_8619)
7.5 Apache httpclient
ที่ใช้กันอย่างกว้างขวางมากที่สุดในรุ่นของ Apache httpclient เป็น 3.1 , เปิดตัวในปี 2007 ห้องสมุดนี้เช่นเดียวกับรุ่นก่อนหน้าของชุดการเชื่อมต่อ SSL ที่ใช้ jsse
ขึ้นเป็น sslsocketfactory โดยไม่แสดงของตัวเองชื่อโฮสต์ที่มีการถ่ายทอด ( ดูส่วนที่ 4.1 และ 4.2 ) .
ผลที่ตามมา , Apache httpclient 3 * ยอมรับใด ๆจึง certi เคท
ด้วยโซ่ที่ถูกต้องของความไว้วางใจ โดยไม่คำนึงถึงชื่อตามที่กล่าวถึงใน
ส่วน 4.2 , ข้อผิดพลาดเดียวกันเกิดขึ้นใน weberknecht .
ชื่อโฮสต์ที่มีข้อผิดพลาดในการถ่ายทอด httpclient ถูกถ่ายทอด xed ในรุ่น
4.0-alpha1 [ 1 ] รุ่นปัจจุบัน 4.2.1 ของตัวเอง , มีโฮสต์
ข้อมูลจึงเอ้อและตัวแทนสาวที่มีประจุบวกจึงจะ jsse . แต่น่าเสียดายที่เราแสดงในมาตรา 8การดำรงอยู่ของการดำเนินงานที่ถูกต้องของ httpclient ได้ผลเพียงเล็กน้อยเกี่ยวกับความปลอดภัยของการใช้งานที่ต้องพึ่งพา httpclient จัดตั้งการเชื่อมต่อ SSL Apache httpclient
4 * เกี่ยวข้องกับออกแบบสถาปัตยกรรมหลัก ,
จึงมากมรดกและแม้ซอฟต์แวร์ใหม่ยังคงอาศัยรุ่น
3 * . การใช้ httpclient มักจะซ่อนอยู่ภายในตลาดบริการเว็บเช่นแกนอยู่ 2 ,ซึ่งหลายปีหลังจากที่รุ่น 4 . * เป็นใช้ได้ยังเรือ httpclient 3 * และดังนั้นจึงข้ามโฮสต์ที่มีประจุ
สำหรับ SSL certi จึงเคทส์
เป็นมูลค่า noting ว่าชื่อโฮสต์ที่กำหนดเองที่มีการถ่ายทอดรหัส
เพิ่ม httpclient 4 * ไม่ถูกต้องและจะปฏิเสธที่ถูกต้องจึง certi
รหัสเคทส์ ต่อไปนี้เป็น httpclient 4.2.1 :
รหัสนี้จะคำนวณความยาวของ Pre ถ่ายทอดโดยการลบ 2
Xจากจำนวนของชิ้นส่วน ( กำหนดโดยจำนวนของจุดใน
ชื่อ ) ตรรกะนี้ไม่ถูกต้อง : ความเที่ยงตรง RST จึงเป็นส่วนหนึ่งของโดเมน
ชื่อจะไม่เกี่ยวข้องกับจำนวนของชิ้นส่วน
การจะปฏิเสธเมล์ < a > . < B > . com ถ้าชื่อใน certi
เคทจึงเป็น M * < > < b > .
นอกจากนี้แพทช์เดิม รวมทั้งอนุพันธ์ได้
ข้อผิดพลาดเล็กน้อยในนิพจน์ปกติสำหรับการ IPv4 ที่อยู่
ก่อให้เกิดการรับที่อยู่ IP ที่เริ่มต้นด้วยศูนย์ ( นี้ไม่ได้
ทันทีผลในช่องโหว่ความปลอดภัย ) :
การแปล กรุณารอสักครู่..
![](//thimg.ilovetranslation.com/pic/loading_3.gif?v=b9814dd30c1d7c59_8619)