Exposure Insecure Deserialization XML External Entities (XXE) Using Components with Known Vulnerabilities Broken Access Control Insufficient Logging&Monitoring
using (SqlConnection conn = new SqlConnection(connString)) { conn.Open(); SqlCommand cmd = new SqlCommand("SELECT Count(*) FROM Products WHERE ProdID=@pid", conn); SqlParameter prm = new SqlParameter("@pid", SqlDbType.VarChar, 50); prm.Value = Request.QueryString["pid"]; cmd.Parameters.Add(prm); int recCount = (int)cmd.ExecuteScalar(); }
{ //Always use a SecureRandom generator SecureRandom sr = SecureRandom.getInstance("SHA1PRNG"); //Create array for salt byte[] salt = new byte[16]; //Get a random salt sr.nextBytes(salt); //return salt return salt; }
[ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "http://127.0.0.1:8888/test.txt" >]> <xml> <stuff>This is my Stuff</stuff> </xml> 開 Port 8888,啟動 python SimpleHTTPServer ,可以遠端傳送 http 請求
reader = new XmlTextReader(stream); reader.ProhibitDtd = true; //NEEDED because the default is FALSE!! Python: from lxml import etree xmlData = etree.parse(xmlSource,etree.XMLParser(resolve_entities=False))
code on Github http://blogs.360.cn/post/eos-node-remote-code-execution-vulnerability.html The Story of an EOS Chain Remote Code Execution Bug 全球最大男性交友網站
Web Assembly Sample Code : libraries/chain/webassembly/binaryen.cpp (Line 78) Function binaryen_runtime::instantiate_module The Story of an EOS Chain Remote Code Execution Bug Out-of-Bounds Write Here • Useless checking here: assert doesn't work in release build • Copy-pasted code from WebAssembly project wasm-js.cpp • No code review & misunderstanding the scope of asser
Web Assembly Sample Code : libraries/chain/webassembly/binaryen.cpp (Line 78) Function binaryen_runtime::instantiate_module The Story of an EOS Chain Remote Code Execution Bug Out-of-Bounds Write Here • Useless checking here: assert doesn't work in release build • Copy-pasted code from WebAssembly project wasm-js.cpp • No code review & misunderstanding the scope of asser
resized before written The valid value of the module->table.initial is 0~1024 The offset is a signed int32 read from WASM file By manipulate the fields of WASM file, we could overwrite memory behind the table vector