start	end	text
10070	12050	Good morning, everyone.
12350	17430	I am very honored to be able to be on the DevCon stage today.
17730	20050	Maybe you can feel it.
20050	23410	Just like when I first participated in DevCon many years ago,
23410	27290	I felt that the style and culture of DevCon
27290	29690	was very different from the academic meetings I used to attend,
29690	32850	especially the academic meetings I attended in China.
32850	37650	For example, there was no leadership instructions,
37650	40350	and there was no academic support.
41770	45830	So I mentioned in the opening video of DevCon
45830	48750	that we really hope that DevCon
48750	52770	can bring some new culture and ideas to China.
53370	58470	You have also seen the translation next to it in the past two days.
58470	60690	Of course, I did this translation myself.
62970	65830	Our foreign speakers, their PPTs,
65830	68290	are some of the volunteers I organized.
68290	71290	Mainly some of our PhD students did some translation.
71290	74870	One of the PhD students sent me his own feelings.
74870	79970	I think at this point, we, DevCon China, have already done it.
81550	82830	In the past few days,
82830	85990	he has already experienced
85990	88310	what it means to be a hacker
88310	88590	in the process of communicating with foreign speakers.
88590	94110	It is probably the curiosity and passion for technology,
94110	96630	the yearning for freedom,
96630	98870	and the pursuit of perfection.
99450	100670	From this point of view,
100670	103550	I think DevCon China has really achieved
103550	106890	the integration of the hacker spirit and Chinese culture.
107990	112070	Today, I mainly want to share with you
112070	114390	some of the research we have done recently.
116270	119570	From the outside, attacking the inside.
119570	124330	Here, we mainly use the latest
124330	128130	or already widely accepted standard
128130	129870	It is called cross-domain,
129870	133310	cross-domain resource sharing.
133450	138190	The main work is done by my PhD student, Chen Jianjun.
138190	142790	But in fact, there is also a cooperation from other units,
142790	146230	including Jiang Jian from SIP Security,
146230	148430	also a former student of mine,
148430	150990	Dr. Wan Tao from Huawei Jiangda,
150990	153310	Dr. Chen Shuo from Microsoft,
153310	156770	Professor Warren Paxson from UC Berkeley,
156770	158130	and Professor Yang Ming from Fudan University.
158450	163710	Our work will be published in August this year.
164110	166230	What is this specific work?
166270	168980	Let's take a look at the current attack scene.
170380	173000	The attackers' attacks on the internet
174520	177780	are usually made by firewalls.
177880	179900	Even a simple address conversion
179900	182900	can make such an attack impossible.
183760	186820	A very intuitive idea is
186820	191160	whether it is possible to attack through the web.
192300	196060	For example, right-wing users click on a website.
196060	197920	This is a website attacked by hackers.
197920	200300	Then through JavaScript,
200300	204260	the attacker's script is loaded into the user's browser.
204260	207380	Then the user's browser attacks the internet.
212410	215530	Of course, if you are familiar with web security,
215530	217510	you may be very clear.
217510	222030	Now, browsers have restrictions on cross-border resource visits.
222250	226050	The most common strategy is SOP,
226050	228190	which stands for Same-Origin Policy.
228190	233810	In the general sense of SOP,
233810	240010	we can imagine that it restricts cross-border visits.
240010	246150	At least you can't read resources from other sources.
248170	252730	But just like safety, performance, and functionality,
252730	255630	they are often a pair of contradictions.
257150	262990	In many cases, developers still need cross-border visits.
262990	266070	So there are all kinds of ways to get around.
266070	270090	One of them is JSON-P, which is more common in recent years.
270090	271790	You may have heard of it.
271790	275850	JSON-P makes it very convenient for developers,
275850	277920	but it also brings a lot of problems.
278330	282870	In recent years, it has become a standard.
282870	287130	For example, cross-border resource sharing.
288190	293270	Now mainstream browsers have achieved this standard.
293270	299290	And most mainstream websites already have this feature.
300010	309070	You can say that cross-border is a feature that provides managers with cross-border visits.
309070	315310	At the same time, it protects the security of resource sharing.
316010	324230	But in recent research, we found that it is not as safe as it was originally designed.
325150	332310	Because of the cross-border feature,
332310	338170	you can access internal resources through the browser,
338170	341530	including creating a new file,
341530	345570	deleting some files in your file server,
345570	349690	and even getting a share on the internal web server.
351810	358130	In the past, there were some loopholes blocked by firewalls in the internal network.
359050	361150	For example, there was a loophole in Strikes 2.
361150	363610	Even if there is such a loophole in the internal network,
363610	364950	the attacker can't get in.
364950	367150	But now, with cross-border,
367150	370250	such an attack may become a reality.
373870	376130	I am a professor at Tsinghua University.
377050	380070	As a professor, Jason Street just mentioned,
381290	385030	I only gave one corner of the truth.
385030	387130	The remaining three corners...
387130	389710	Let's welcome my student, Chen Jianjun.
389710	393770	Chen Jianjun is a Ph.D. student at Tsinghua University.
395390	400330	He is my first Ph.D. student.
400570	402490	He is about to graduate.
402490	405210	His next step is to go to Berkeley for a Ph.D.
406070	407530	He has already achieved a great success
407530	411670	in the four top universities in the academic circle.
413530	417610	Today, let's welcome Chen Jianjun to share with us
417610	422790	the research on the cross-border attack on the internal network.
423130	424410	Jianjun.
430520	434020	It is a great honor to be here at DEVCON.
434220	435680	I would like to share with you
435680	439740	the article that is about to be published on User-Lead Security.
440400	444960	I will talk about the details in four aspects.
445580	449860	First, I will talk about the background of the web and cross-border.
449860	453020	Then, I will talk about the security issues of the three cores.
453820	457240	Then, I will talk about the security situation of the cores in a real website.
459140	461920	Finally, I will talk about how to defend against such issues.
462160	464480	First, let's look at the background of the web.
464980	466420	Since we are talking about the security of the web,
466420	468560	let's talk about the synchronization strategy.
468780	471060	The synchronization strategy defines a circle.
471060	472320	It is composed of three groups,
472640	474520	which are the protocol, domain name and port.
474720	476360	Generally speaking,
476360	481760	the synchronization strategy is that it is isolated from two different circles.
481760	484980	One circle cannot operate the data of another circle.
484980	485940	It cannot cross-circle.
486900	489680	For example, A.com cannot operate the data of B.com.
490340	495100	However, this is just a misunderstanding of DOM.
498960	501500	SOP has different restrictions on different network resources.
501500	502220	Let's look at the details.
502220	503560	For example, in this place,
511560	515680	A.com wants to send a request to B.com
515680	518040	and read the resource response of B.com.
518040	520720	How will the synchronization strategy restrict it?
521240	524460	It is not that it cannot be visited at all.
524620	526420	It can be sent.
526420	529240	A.com can send a request to B.com,
529240	531400	but it cannot read the response.
534470	535290	Why do I say it is a misunderstanding of DOM?
535290	536490	It can be sent.
538020	540130	For example, here is a simple example.
540130	544130	A.com's HTML file is automatically submitted to B.com.
544430	548830	It can also automatically click on the form request
548830	553490	and send the request to B.com.
553490	555090	This is a POST request.
555980	558010	What kind of harm does this bring?
558450	560110	It brings two harms.
560110	561830	The first one is the attack of CSRF.
562830	564610	As mentioned in the previous report,
564610	567210	you used the login CSRF attack on my account.
567430	569610	Let's talk about the principle of the CSRF attack.
569890	574210	First, the victim logged into his own bank website
574210	577290	and set a KUKA in the browser.
578970	582450	Second, when he logged into the bank and operated the bank website,
582450	584970	he wanted to check the information
584970	587450	and accidentally visited the attacker's website.
587450	589230	However, due to the restriction of the synchronization strategy,
589230	592510	even if he visited the attacker's website,
592510	594250	he couldn't read the information directly from the DOM.
596630	598330	This is the restriction of the synchronization strategy.
598630	600890	However, the request is not restricted by the synchronization strategy.
602050	605170	The attacker can send a POST request to the bank website
605170	605990	through his own website,
605990	607670	through the browser operated by JavaScript.
611650	615370	In this request, KUKA is used.
615370	617870	KUKA will be automatically added to each request.
617870	623750	In this way, the user's KUKA is included in the POST request.
623910	631330	Then, when the KUKA verifies the origin of the request
631330	631430	through the bank website,
631430	635160	he thinks that the request was done by the victim himself.
635530	637250	So he executed this operation
637250	641450	and transferred the bill to the attacker's account.
643650	647770	The second type of attack is the HTML form protocol attack.
648590	653090	This attack means that
653090	655870	the attacker can use the victim's browser
655870	657970	to cross-protocol attack.
657970	661750	For example, he wants to attack an SMTP server, an email server.
663130	667990	First, the victim accidentally clicked a link, right?
670010	672490	Then, the JavaScript in this link
672490	675110	sends a POST request to the user's browser.
675930	677390	In this POST request,
677390	680890	the attacker can construct the body of the request
680890	685910	to construct some SMTP commands in it.
685910	687410	In this process,
687410	690790	due to the strong tolerance of many services,
690790	694250	he will ignore the unknown commands
694250	697710	and execute the SMTP commands he knows in it.
698590	703090	In this way, he can use the user's browser
703090	706590	to send an email to the email server.
709450	712150	Maybe this email server is in the user's network
712150	715770	and can cross-network and cross-protocol attack.
720020	721240	As we mentioned earlier,
723480	724720	SOP has two parts.
724720	726000	One is cross-development.
726080	729460	It can be allowed to send, but it can't be read.
729500	730220	It can be allowed to send,
730220	732820	but the harm is the attack of CSF, HFPA.
734360	736120	But it can't be read.
736120	737740	This affects the web
738440	740940	and limits the development of the web.
741060	742920	Many times, the web needs a language
742920	744520	to read other languages.
744520	746520	For example, an e-commerce website
747780	751660	may want to read a package information of a courier company
751660	755220	and then track a package on its own website.
755320	758220	How does this function work?
758220	761440	It needs a cross-source reading information.
763740	766540	In order to achieve this cross-source reading,
766540	767600	but SOP doesn't allow it,
768620	771800	the developers came up with some ad-hoc solutions.
772820	776780	The JSONP solution was first proposed in 2005.
778560	781060	This solution is very dangerous.
784020	786360	JSONP brings a series of security issues.
786360	788700	The most prominent security issue is that
788700	791380	JSONP itself does not have an anti-counterfeiting mechanism.
791380	794460	It can't say which website I want to visit
794460	795960	and which website I don't want to visit.
796000	797800	In order to solve this problem,
797800	800660	the JSONP solution came up with CORS.
802040	806840	In Chinese, CORS stands for cross-source sharing.
807180	810640	It is an anti-counterfeiting mechanism that shows authorization.
815840	819060	Its principle is to generate an anti-counterfeiting strategy
819060	821440	to limit the scope of SOP.
823520	826300	In 2009, this protocol was supported by all browsers.
826620	829260	In 2014, it became W3C's standard.
829260	831060	This is how the protocol works.
831500	832580	It is quite simple.
832580	834480	It is divided into three steps.
835120	840340	For example, now the browser has loaded a Javascript from A.com.
840340	842480	After that, Javascript will issue a cross-source request.
842480	844040	For example, I want to issue a cross-source request to B.com.
844040	846680	During this process,
846680	852220	the browser will add an origin header to the request
853820	857320	to mark that the source code is from A.com.
857940	862800	Then the server will generate an anti-counterfeiting strategy
862800	862840	based on the request's origin,
862840	864900	which is called access-control-alone-origin,
864900	865720	and put it in the corresponding header
865720	869080	to show that I am allowed to visit A.com.
869720	873940	After the browser sees the corresponding header,
873940	875780	it will compare the origin of the request
875780	878380	to see if the corresponding strategy is consistent.
878380	879360	If it is consistent,
879360	880980	it will allow the Javascript to be read.
880980	882340	If it is inconsistent,
882340	884260	it will not allow the Javascript to be read.
884440	885720	The principle is very simple.
885720	887560	It is divided into three steps.
888960	893640	But Quartz also provides some more detailed control,
895840	901260	including method, header, and credentials.
902860	904740	Including cookies and the like.
907620	909880	For example, here is a simple example.
909880	914200	When XHR sends a request,
914200	918040	it allows the user to customize the method,
918040	920000	customize the header,
920000	922680	and customize whether to bring a cookie.
922740	924060	But what is the problem with this?
924060	925900	It is too flexible.
925960	927360	It is too flexible for the web.
927360	931360	It may damage some applications' CSR defense.
931360	935860	Some applications rely on the customized header to do CSR defense.
935880	938440	So Quartz divides the request into two categories.
938460	939600	One is a simple request,
939600	941080	and the other is a non-simple request.
941080	943100	A simple request can be sent directly.
943720	945280	Just like the previous process,
945280	946220	the request can be sent directly.
946220	947240	It is not harmful to the server.
947240	948280	I will go directly to the request,
948280	950260	and then you return me the visit policy.
950980	953700	But a non-simple request is not safe.
953700	955200	It cannot be sent directly.
955200	958480	It requires an additional verification operation.
959540	961980	How to judge whether a request is simple or not?
962000	963340	There are three conditions.
963340	965540	These three conditions look complicated.
965700	967080	The principle is simple.
967080	968720	It is the white list mechanism.
969020	971860	The request header must be in the white list.
972140	973900	The request method must be in the white list.
974040	976740	The content type value must also be in the white list.
979160	980860	What if it is a non-simple request?
980860	981980	How to do it?
982420	984100	Since the request cannot be sent directly,
984100	987760	I will send a preflight request first.
987760	989760	This request is safe.
990180	994400	There is no user-created header.
994400	997240	It is a header built in the browser.
997500	1001860	It tells the server that I am going to send this request later.
1001860	1002820	There is a dangerous request.
1002820	1003920	Will you let me send it?
1004020	1006080	Then the server says you can send it.
1006080	1008220	Then it checks whether this strategy is allowed to be sent.
1008780	1011140	Then it performs this real operation.
1011140	1013680	It is equivalent to adding a part of the request process.
1013680	1014400	It is divided into two parts.
1014400	1015180	One is preflight.
1015180	1018200	The other is a real interview.
1023060	1024880	What kind of problems may arise with such a cross mechanism?
1025980	1028960	Here we found three problems.
1029240	1033220	The first is that it is too relaxed to send the front end.
1033320	1035280	It may cause security issues.
1039020	1042360	Just now we talked about the request to automatically submit a post.
1042360	1044700	It has caused a huge security threat to the current web.
1044700	1047980	Such as the attack of CSF and HLPA.
1051300	1056400	But when CORS designed the XHR interface,
1056400	1061160	it is hidden and relaxed the forwarding front end.
1061400	1064840	It can give the attacker a more flexible front end
1064840	1066780	and bring some new security issues.
1066780	1072120	We found that using this new security front end
1072120	1074180	can bring four types of attacks.
1074920	1077000	The first type of attack is that
1077000	1081400	it can attack the second-level protocol services of the internal network
1081400	1084960	to create and delete the internal network files.
1085060	1088100	It can also attack the code execution loopholes of the internal network
1088960	1091300	to get the files of the internal network server.
1091300	1095920	It can also attack the CSF loopholes that could not be used before.
1095920	1102340	It can even speculate the privacy information of any website.
1102340	1106740	These loopholes are not only the loopholes of the service end,
1106740	1108080	but also the loopholes of the browser.
1108260	1110340	So in March, we have...
1114280	1116460	In March, we have...
1116460	1118640	I can't synchronize.
1118640	1123720	In March, we have reported the loopholes to the browser manufacturers.
1125580	1129680	But the browser manufacturers haven't fixed it yet.
1129940	1133740	We reported it to Chrome, Firefox, Safari, Edge and IE.
1134000	1140740	The main problem is that it may bring some destructive effects to the current web.
1140900	1143400	If it needs to be fixed, it may have side effects.
1143400	1145440	So it is difficult for them to fix it.
1145440	1150020	They ask us not to reveal the details of the loopholes on DiverCon China
1151380	1155580	to check if our PPT is safe.
1156240	1158120	So they attach great importance to this issue.
1158120	1159760	We also agree with their advice.
1159760	1163660	But what we can do now can't let you down.
1163660	1166960	So let's play a video.
1168520	1172120	Please let the staff play the video.
1172220	1174360	On the left is a browser.
1174360	1178000	On the right is a remote attacker.
1178000	1180380	The user on the left refreshes the browser.
1180600	1186580	The attacker on the right gets the server.
1190870	1193750	This is the attack effect.
1198230	1205210	Now let's talk about the key points of today's talk.
1206270	1208590	The first one is the risk of trust.
1208670	1212130	The safety issue caused by the risk of trust.
1216920	1222520	The core function of the course requires a user to trust another user to share the data.
1222520	1227500	Of course, this kind of trust may increase the risk of attack.
1228300	1230600	A website may not have a security loop.
1230600	1232380	But it has a security loop in the trust area.
1232380	1236020	In this way, the attacker can use the security loop in the trust area
1236940	1241420	to attack the security loop in the trust area indirectly.
1242620	1247380	Here we find that there are two types of risk of trust.
1249220	1252940	The first type is the HTTPS trust HTTP.
1255820	1260860	HTTPS can provide confidential and complete protection for the network communication.
1260860	1263060	Even if the network is not safe,
1263060	1268520	it can ensure that the middleman in the network cannot read the data in it.
1269100	1276380	But if an HTTPS website trusts an HTTP website,
1277580	1281280	the attacker can first hijack the HTTP website.
1281280	1283660	Then through the HTTP website,
1283660	1286540	send a request to read the resources of the HTTPS website.
1287360	1290520	Here is a diagram of the process.
1291740	1294360	When the victim visits another website,
1294360	1295760	the attacker enters an iframe
1295760	1300680	and forces the victim to visit the HTTP example.com.
1303200	1306620	Then the attacker hijacks the HTTP example.com
1307280	1309600	and enters some malicious JavaScript.
1311280	1317520	Then the JavaScript sends the request to the HTTPS server.
1319440	1323140	The HTTPS server is obviously from the HTTP example.com.
1323140	1324620	I trust it.
1324940	1327340	It returns the resources.
1328600	1332240	Then the attacker's JavaScript gets the content.
1333000	1336460	Then it can send the content to the attacker.
1336460	1342960	This is the effect of the middleman hijacking the HTTPS website.
1344580	1346500	The second type of reliance,
1346500	1347920	which is risky,
1347920	1349580	is the reliance on other fields.
1349600	1353300	For example, the reliance on all subsidiary fields.
1355000	1356520	The danger of this
1356520	1358440	is that a subsidiary field's CSS
1358440	1362580	may affect the security of the main field.
1363280	1365500	For example, we found a case here.
1365500	1367320	This is mail.riu.
1368520	1369340	Its main field
1369340	1374160	has a very strong security defense.
1374160	1375720	It deploys CSP,
1376080	1376960	HTTP Owing,
1376960	1377280	Cookie,
1377280	1378420	to prevent this CSS
1378420	1380620	and provide a loophole reward.
1381380	1384140	But its subsidiary field does not deploy CSP
1385000	1386520	and does not provide a loophole reward.
1386520	1388440	So it is very easy to find a subsidiary field's CSS.
1388920	1390900	But its main field trusts all subsidiary fields.
1390900	1391280	So we
1393960	1395280	found such a loophole
1395280	1397760	to use this subsidiary field's CSS
1397760	1400060	to read sensitive information on the main field.
1402160	1405660	The second one is that it trusts the third party's domain.
1405660	1406920	It may bring a security risk.
1406920	1408000	As I just said,
1408000	1409580	even if your domain is safe,
1409580	1412680	it cannot guarantee that your information is not leaked.
1412680	1414400	Because you may have a security problem
1414400	1416000	with the third party's reliance.
1416740	1418840	We found a case here.
1419200	1420840	A Korean e-commerce website
1420840	1422660	has expired its trusted domain name.
1423320	1425920	The attacker can register the expired domain name
1428200	1429940	to carry out the attack.
1432720	1436840	The third problem is the complexity of the course strategy.
1437700	1440240	We found that four types of course strategies
1440240	1442520	are prone to misconfiguration.
1444940	1447220	We know that the core of the course
1447220	1449500	is to generate a network control strategy at the service end
1449500	1453300	to guide the browser to expand the SOP limit
1455300	1456980	and achieve cross-domain sharing.
1456980	1460420	But if the course strategy is wrong
1460420	1461860	and the generation is wrong,
1461860	1465020	it may lead to the trust of an attacker
1465020	1467880	to achieve the SOP bypass.
1470020	1472280	As for the misconfiguration of the course,
1472280	1476060	there have been a lot of research by researchers.
1476060	1477560	Here we summarize the previous research
1477560	1481960	and find some new cases of misconfiguration.
1484020	1486080	Let's watch a video
1486080	1489120	on how to bypass the SOP limit
1489120	1494300	to read the information on the SOHU video website.
1495920	1497860	This loophole has been broken.
1499240	1501020	So it has been fixed.
1501020	1503520	Let's look at the SOHU video.
1503520	1504960	This is a website of Alex Top,
1506040	1509540	ranked 5th in China and 14th in the world.
1514590	1516770	We can see that there is only one acquisition address in the acquisition address.
1516770	1517210	Right?
1517570	1518590	Only one acquisition address.
1518970	1524850	Then let's visit the attacker's evildoing.com.
1524850	1527630	We find that it has become two acquisition addresses
1527630	1529050	and can read the user's information.
1529050	1532490	Let's see if it has become two user addresses.
1532490	1535830	We find that it can not only read the user's information
1535830	1538350	but also write information to the user's account.
1539810	1541710	So this is a very serious hazard.
1541730	1545350	Let's see why there is a misconfiguration of the course strategy.
1545350	1546770	What may happen?
1547930	1550190	First of all, the strategy of the course is
1551470	1553470	that the access control alone origin
1553470	1555150	allows the configuration of the value.
1555470	1556990	There are two standards for the course.
1556990	1558230	One is the W3C standard,
1558230	1560130	and the other is the WG standard.
1560130	1561670	The WG standard is a standard
1561670	1564470	launched by several browser manufacturers.
1564810	1566630	In the W3C standard,
1566630	1570190	the access control alone origin can be an origin list,
1570190	1571850	or a NOR, or a signal.
1571850	1574450	But in the WG standard,
1574450	1576870	it can only be a single origin,
1576870	1578390	or a NOR, or a signal.
1580090	1582190	And in all the browsers,
1582190	1583030	all the browsers we tested
1583030	1585310	followed the WG standard.
1585310	1586510	That is to say,
1586510	1589310	only such a configuration,
1589470	1591250	a green configuration, is legal.
1591390	1593010	And the other two configurations
1593010	1594990	are all wrong.
1597850	1598830	We found that
1598830	1601210	many websites did not notice this.
1602110	1603230	The issue of the origin configuration
1605310	1607690	actually includes some large websites
1607690	1608870	with the origin configuration.
1609570	1611170	And although this configuration
1611170	1612250	cannot cause security issues,
1612250	1614090	it is indeed a misconfiguration.
1618760	1619280	Uh...
1620740	1622980	So, if a website
1622980	1626220	wants to share data to multiple regions,
1626220	1627120	what should it do?
1628440	1629920	I just want to be able to
1629920	1631660	share data to A.com and B.com at the same time.
1631660	1633480	Then we must have a dynamic
1633480	1635380	access control strategy.
1637060	1639020	In this dynamic process,
1639020	1640320	we found that in fact,
1640320	1641760	security issues are very easy to occur.
1642360	1644480	We have four types of security issues.
1644560	1645560	The first type of security issue
1645560	1646340	is...
1646340	1648280	We have five types of security issues.
1648280	1649860	The first type of security issue is...
1649860	1650800	Many websites
1650800	1651620	when configuring this
1651620	1653740	configuration strategy,
1653740	1655800	there is an example here,
1655800	1657340	which is a configuration of NGX.
1657380	1659520	Directly add this
1659520	1660760	access control
1660760	1661700	to this NGX.
1661700	1662800	Alone origin,
1662800	1663960	ATP origin.
1665620	1666540	It is equivalent to
1666540	1668200	reflection of any origin header.
1668200	1668920	This can achieve
1668920	1669720	the effect of functionality.
1669720	1670560	However,
1671840	1672740	the harm is that
1672740	1674300	it trusts any language.
1674300	1675240	It is equivalent to
1675240	1677060	the SOP of the browser.
1677060	1678040	It completely fails.
1678520	1680740	Any language can be read directly.
1682700	1683580	This configuration
1683580	1684380	is also the highest
1684380	1686260	in our discovery.
1686260	1688700	is also the highest
1688700	1688860	in our discovery.
1688860	1690640	In 2016,
1690640	1691240	someone did
1692440	1693660	for X-top 1 million.
1693660	1694320	a statistic for X-top 1 million.
1694320	1694920	The result of the measurement
1694920	1695880	is that there is a problem
1695880	1696520	in each of the 10 websites
1696520	1697640	that configure the course.
1697640	1698240	that configure the course.
1699380	1700620	And in our recent
1700620	1701600	measurement,
1701960	1704380	there is a configuration
1704380	1705100	that comes out
1705100	1706540	with this problem.
1706920	1708000	Although this configuration
1708000	1710760	does not look obvious,
1710760	1711480	but in fact,
1711480	1712440	it is very harmful
1712440	1713320	and it is very easy
1713320	1714400	to have this problem.
1718610	1719130	The problem with
1719130	1720410	the previous configuration
1720410	1721650	is that
1721650	1723270	it does not do any training.
1723290	1724410	What is the origin header?
1724410	1725710	What is the origin header
1725710	1726230	I allow?
1726330	1726710	Then
1727730	1729130	there is a more advanced
1729130	1730250	error method,
1730250	1730910	that is,
1731530	1733290	I take a look at this origin header
1733290	1733890	I take a look at this origin header
1733890	1735970	whether it is the origin header
1735970	1736310	I want.
1736310	1736510	whether it is the origin header
1736510	1736590	For example,
1736590	1737110	here is a configuration
1737110	1738190	of NGX.
1739170	1740310	Is this configuration
1740310	1741890	safe?
1744570	1745490	This is
1746350	1748190	obviously not safe for us.
1748610	1749250	It is that
1749690	1751290	there is a lack of
1751290	1751990	an end service
1751990	1752670	at the last place.
1753070	1753990	Then the attacker
1753990	1757110	can add a
1757110	1757450	.evil.com
1757450	1758930	.evil.com
1758930	1759190	to realize
1759190	1760790	the bypassing strategy.
1760790	1761290	The example
1761290	1762210	we just demonstrated
1762210	1763530	in the video
1763530	1763790	is the example
1763790	1765050	of the search video
1765050	1765370	that made this mistake.
1768330	1769170	The search video
1769170	1770630	we put this loophole
1770630	1772150	because the search itself
1772150	1772890	does not have a
1772890	1773730	safe response center
1773730	1774350	we reported this loophole
1774350	1774870	to them through
1774870	1777230	freebuff.
1777230	1777950	But they fixed
1777950	1778070	this problem
1778070	1779910	but did not fix it well.
1779910	1780050	What is the reason
1780050	1782030	for not fixing it well?
1782030	1783370	The first error
1783370	1783770	avoidance
1783770	1784790	jumped into the second
1786910	1789510	error pit.
1789510	1791190	What is the second error pit?
1791190	1791910	I can't see
1791910	1795050	its misconfiguration.
1795050	1796790	This is me
1796790	1797070	on stackoverflow
1797070	1797210	to see
1794950	1795950	a configuration method
1795950	1796950	recommended by others.
1798990	1800170	I see this
1800170	1801030	because the previous configuration
1801030	1801290	said
1801950	1802890	you do not have
1802890	1803990	the example.com
1803990	1805250	there is a security issue.
1805250	1805850	Then I will check
1805850	1806350	whether you are
1806350	1806570	at the end of
1806570	1807310	the example.com
1808510	1809550	right?
1810890	1812090	But this is also
1812090	1812630	problematic.
1812630	1814010	What may be the problem?
1815930	1816910	The attacker can
1816910	1818090	send such a
1818090	1819210	attack example.com
1819910	1820310	It is also
1820310	1820530	at the end of
1820530	1821530	the example.com
1821530	1822830	But this domain
1822830	1823350	can be registered
1824010	1825390	by the attacker.
1826810	1827970	So it is also
1827970	1828650	not safe.
1830110	1830810	We also reported
1830810	1831530	this error pit
1831530	1834290	to him.
1837410	1838050	I haven't seen
1838050	1839690	if it has been fixed.
1839710	1840150	It was reported
1840470	1841530	a few days ago.
1846510	1846830	Then
1846830	1847270	this
1848170	1848870	did not transfer
1849390	1850510	the last two types
1850510	1851630	did not transfer
1851630	1852550	this
1854730	1855890	point.
1855890	1856790	Many websites
1856790	1857870	will check
1857870	1858030	when they
1858030	1858090	hold the
1858090	1858330	origin
1859510	1860470	they will
1861010	1861610	use the
1861610	1861930	positive expression
1861930	1863110	to check.
1864130	1864690	When they
1864690	1865230	write the positive expression
1865230	1865930	they did not
1865930	1867070	transfer this point.
1867890	1868670	This causes
1868670	1869150	this point
1869150	1869530	to be replaced
1869530	1870510	by any alphabet.
1872570	1873370	Because in the
1873370	1873650	positive expression
1874390	1874630	a point
1874630	1875770	is a
1875770	1877750	common match.
1877750	1878350	So it can
1879070	1879230	cause
1879230	1880250	a security issue.
1880250	1880770	We also found
1880770	1883190	that there are websites
1883190	1883570	that even
1883570	1885870	have purple-wearing matching.
1885870	1886870	We found
1885870	1886450	that as long as
1886450	1886790	the host
1886790	1888170	from the
1888170	1888450	origin
1890310	1890790	is
1891530	1891930	a self-proclaimed
1891930	1892430	purple-wearing
1892430	1892670	host,
1892670	1893670	it is allowed.
1898730	1899570	We talked about
1899570	1899910	the five types
1899910	1899930	of
1899930	1900170	matching
1900170	1901110	earlier.
1907070	1907550	Then
1907550	1908030	we will
1908730	1909690	look at
1909690	1910550	the second
1910550	1910790	category
1910790	1910870	of
1910870	1911290	questions.
1911290	1911690	The first one
1911690	1912850	is the
1912850	1913510	x-control
1913510	1913530	we just
1913530	1913610	talked about.
1913610	1913750	There can
1913750	1914450	be three
1914450	1919090	types of
1919090	1919550	questions
1920090	1920590	in
1922970	1923910	The
1923910	1924230	first
1924230	1925250	one is
1925250	1925470	in
1928810	1929280	RFC
1930490	1931430	6454
1931430	1932230	where
1932230	1932590	it is
1932590	1932830	defined as
1932830	1934790	if a
1934790	1935260	language
1936010	1937130	comes from
1937130	1937830	a
1937830	1938570	private
1938570	1939270	domain,
1939270	1940090	then
1940730	1941190	the
1941190	1941670	query
1941670	1941990	origin
1941990	1942830	cannot
1942830	1943330	directly
1943330	1943610	show
1943610	1943690	the
1947090	1948090	domain.
1943690	1946250	I will set it to this one.
1946770	1952810	But it didn't define what is a private sensitive domain.
1953230	1955350	Local documents are considered a private sensitive domain.
1955350	1956450	Is there anything else?
1958150	1962610	So when many websites are doing this hyper app,
1962610	1964690	that is, when mixing apps,
1967350	1968690	it allows this...
1968690	1973830	Because the hyper app needs this ATM25 to do the interface.
1974670	1976270	It will allow this...
1976270	1979250	JavaScript will send a request directly from the local file.
1979250	1980870	The output is a lore.
1981770	1984470	It allows this lore to read.
1984470	1985290	But it brings...
1985290	1987530	We found that in the actual browser,
1987530	1990890	this lore can be forged by any website.
1992490	1995770	Through this iframe sandbox script.
1997510	2002590	This means that all trustable lore websites are not safe.
2002590	2005190	It is also a trustable website.
2006670	2010850	The yellow one is our POC.
2012830	2017550	This kind of lore example has also caused a lot of security issues in history.
2017630	2020850	For example, in 2016,
2020850	2023570	Facebook Messenger was discovered.
2023570	2025830	Because of this trustable lore,
2025830	2028170	any user can read it.
2028170	2034450	And any attacker can read Facebook Messenger's chat message.
2037990	2039590	The third category is...
2039850	2042690	Let's see what kind of problems the signal might bring.
2045330	2049550	The signal in the course allows any desire.
2049550	2051030	It looks very intuitive.
2051030	2053030	But it allows any desire.
2053030	2056030	It is too loose.
2056490	2059190	The course has another rule.
2059190	2062050	The signal can't be used with Cookies.
2062050	2064150	It can't be used at the same time.
2064830	2068230	This means that the signal can only be shared in public.
2068230	2069770	It doesn't need authentic resources.
2069770	2071550	If you want to bring Cookies to visit this resource,
2071550	2073170	you can't use the signal.
2073530	2075810	And all browsers follow this standard.
2075810	2077090	As long as you match this configuration,
2077090	2078150	it is considered unsafe.
2078190	2081870	It will refuse to say that this configuration is a false configuration.
2082550	2086050	In the actual website,
2086050	2090850	we found that many websites didn't notice that this configuration is a false configuration.
2091510	2094090	Including some big websites.
2094650	2096270	For example, security.harvard.edu.
2096270	2100550	It is not the security department.
2100550	2103550	It is the information security department of Harvard.
2104750	2106630	There is still no configuration.
2107410	2109290	The problem is that there is no configuration team.
2113670	2116190	What is more interesting is that
2116190	2117990	we found that there is a framework.
2117990	2120790	Because the configuration signal and true will be wrong,
2120790	2122830	the framework will take the initiative to convert the signal and true
2123910	2126210	into a reflection-friendly orange.
2126210	2129030	The reflection-friendly orange we mentioned earlier is very dangerous.
2131470	2135410	We tested 11 mainstream frameworks.
2135410	2136530	We found that there are 8.
2136610	2141070	If the user directly matches the signal and true in this configuration,
2141070	2146250	it will take the initiative to reflect it into a reflection-friendly orange.
2148110	2151290	The fourth problem is the security problem caused by the course and cache.
2160110	2163470	For example, there is a resource server, c.com.
2163470	2168570	It wants to share data with a.com and b.com at the same time.
2169350	2174530	If the user first visits c.com via a.com,
2176310	2178570	and then c.com returns and says,
2178570	2181030	I allow a.com, you are in my list.
2183250	2184910	Then the user...
2184910	2188430	But this response will be delayed by the middle cache.
2188870	2193690	It may be a browser cache or a transparent cache in the middle.
2196960	2203080	So if b.com also wants to visit the resources of c.com,
2203080	2204860	but it will be detected by this cache.
2206360	2212140	Then the feedback is to allow a.com to save the content before.
2212260	2215660	This a.com obviously does not match the b.com issued by the request.
2216120	2219080	This leads to the failure of the b.com in the later visit.
2219900	2224340	This leads to a failure of the function of the course.
2228280	2230060	For this kind of situation,
2230060	2234780	the ATP protocol provides the VeryHeader to solve this problem.
2234780	2239360	When you set up the VeryOriginHeader in the response to guide the cache,
2239360	2243720	you have to drag the origin into the cache key.
2243960	2249060	Of course, we found that many websites,
2249060	2252780	when developing anti-cache control strategies,
2252780	2255340	did not match the VeryOriginHeader.
2261640	2266200	Now we have found a bunch of mis-configuration problems.
2266460	2269500	Let's take a look at the real website.
2269500	2271760	What kind of security problems may there be on the real website?
2272040	2274080	What will the security situation be like?
2274860	2277140	We are going to do a measurement in four parts.
2277800	2280060	First, we select the target.
2280880	2288140	We select a website with 50,000 AlexTurps as our measurement target,
2288140	2290280	because it is a highly influential website.
2291320	2294840	Then we extract their domain name from the 50,000 websites.
2295720	2298140	We extracted 90 million domain names.
2298320	2301800	The data comes from the passive DNS data provided by 360 Internet Security Union.
2305780	2312300	Then we dynamically detect the configuration of the course for each domain name.
2312560	2315840	Why do we have to detect it dynamically, instead of scanning it directly?
2316000	2319940	Mainly because the anti-cache control strategy of the course
2319940	2323400	does not return to each response directly.
2323420	2325380	Because it needs to be dynamically generated.
2325660	2329100	Only if your OriginHeader hits its anti-cache control strategy,
2329100	2329940	will it return.
2330300	2331780	If you don't have an OriginHeader,
2331780	2334380	or OriginHeader does not hit its anti-cache control strategy,
2334380	2335320	it will not return.
2337180	2339880	So we need to take the initiative to detect it.
2341580	2345120	For example, here we are going to detect if the service end has the configuration
2346120	2349260	to allow NOR to visit.
2349260	2352660	We set the OriginNOR in the request,
2352660	2354640	and then see if it returns the access control,
2354640	2358040	along OriginNOR, such a value.
2360340	2363440	The result of the test is that we found that 480,000 domain names
2363440	2365540	are configured to the course.
2366240	2369270	Basically, it covers every website of X50,000.
2372220	2375120	Among them, 130,000 are configured to have a problem,
2375120	2377080	which is about 27.5%.
2377080	2382820	So this problem is widespread on the Internet.
2383300	2384040	This kind of...
2384920	2386960	Electro 50,000 is relatively safe.
2386960	2390160	Not to mention other websites that are not on this list.
2393260	2395320	So how to prevent this kind of loophole?
2396360	2403800	We reported all the security problems we found to the relevant manufacturers.
2405740	2407280	Some manufacturers have already fixed it,
2407280	2408200	such as Sohu.
2408200	2409840	Some are still being fixed.
2410580	2414300	For such a problem, how to prevent it?
2414440	2416240	This problem is divided into two aspects.
2416240	2420080	One is the overloading of the course.
2420160	2422360	The other is the problem of read configuration.
2422800	2424700	For overloading,
2425260	2427360	we reported to the Chrome browser,
2427360	2428180	Firefox browser.
2428180	2431060	They haven't released the fix yet,
2431060	2433240	but one of the preventive measures they want to do is
2434080	2439960	to prohibit external websites from visiting the internal network.
2440100	2442660	That is, cross-network is not allowed.
2443060	2445020	Use the browser as a jump board to visit the internal network.
2448440	2451140	As for the problem of misconfiguration,
2451140	2452280	we found that...
2452800	2455220	Of course, we can blame the developers for not noticing it.
2455220	2457860	Of course, the developers have to bear a lot of responsibility.
2457940	2460800	Another big responsibility is that the course has a lot of
2463020	2464140	weird cases,
2464140	2465280	such as the case of Nord.
2466300	2469920	Many websites do not clearly write this standard.
2470140	2476260	Many website developers do not know there is such a weird case.
2476260	2482180	So it's best to clarify all kinds of security risks in this standard.
2483520	2486260	And what the website manager can do is
2488780	2491660	check if your course configuration has this problem.
2491780	2496320	We provide a source tool,
2496320	2498540	which is the course scanner.
2499860	2505360	You can use this to scan a website to see if it is safe.
2505360	2507700	This is a screenshot.
2508560	2512580	We scanned the top 100 websites,
2512580	2514520	and we found a lot of misconfiguration.
2517240	2520360	You are welcome to download and use this tool.
2520780	2522620	Since I used this tool,
2524940	2527000	I don't find bugs every day at work.
2527000	2528260	There are too many bugs,
2528260	2529640	because there are too many misconfigurations.
2529640	2530620	I can't handle it.
2531020	2532820	So you are welcome to use this tool.
2532820	2537920	You can definitely find a lot of security issues.
2547490	2549870	To sum up,
2552830	2554430	there are three types of problems with the course.
2554430	2559770	The first one is that it may cause security issues for the internal network
2559770	2559810	due to its too lenient forwarding.
2559810	2560910	This is not detailed,
2560910	2564330	but it is a very important contribution to our work.
2564330	2568390	Maybe we will talk about this specific security issue
2568390	2569410	in the next session.
2569410	2570650	The second type of problem is that
2570650	2572490	the course brings new people's dependence
2573770	2575730	and new people's security risks.
2575730	2576550	The third type is that
2576550	2579070	there are a lot of corollary cases in the course.
2580670	2582750	There are a lot of misconfigurations
2582750	2583350	in the actual website,
2583950	2586350	which brings new security issues.
2587030	2588510	This is my report.
2588670	2589350	Thank you.
