38 · Examining the Security Threat Landscape檢視安全威脅態勢

Buffer Overflow Attacks緩衝區溢位攻擊

Attackers can analyze network server applications for flaws. A buffer overflow vulnerability is one type of flaw. A buffer is a typically volatile or nonpersistent memory to "buffer" inputs or outputs. Buffers are a very common approach with most software components and are typically allocated from system memory. Suppose that a service accepts input and expects the input to be within a certain size but does not verify the size of input upon reception. In that case, the corresponding buffer overflows and may become vulnerable to a buffer overflow attack. This means that an attacker can provide larger than expected input, and the service will accept the input and write it to memory, filling up the associated buffer and overwriting adjacent memory. These overwrites may corrupt the system and cause it to crash, resulting in a DoS. In the worst cases, the attacker can inject malicious code in the buffer overflow, leading to a system compromise.

攻擊者會分析網路伺服器應用程式以尋找瑕疵,緩衝區溢位(Buffer Overflow)弱點就是其中一種瑕疵。緩衝區是一種通常屬於揮發性或非持久性的記憶體,用來「緩衝」輸入或輸出資料。緩衝區在大多數軟體元件中都是非常普遍的做法,通常是從系統記憶體配置而來。假設某項服務接受輸入,並預期輸入資料在特定大小範圍內,但在接收時並未驗證輸入的大小,此時對應的緩衝區便可能溢位,並容易受到緩衝區溢位攻擊。這表示攻擊者可以提供超過預期大小的輸入,而該服務仍會接受此輸入並寫入記憶體,填滿相關的緩衝區並覆寫相鄰的記憶體。這些覆寫動作可能會損毀系統,導致系統當機,造成阻斷服務(DoS)。在最糟的情況下,攻擊者可以在緩衝區溢位中植入惡意程式碼,導致系統遭到入侵。

Buffer overflow attacks are a common vector for client-side attacks. Malicious code can be injected into data files, and the code can be executed when a vulnerable client application opens the data file.

緩衝區溢位攻擊是用戶端攻擊常見的攻擊向量。惡意程式碼可以被植入資料檔案中,當有弱點的用戶端應用程式開啟該資料檔案時,程式碼就會被執行。

For example, assume that an attacker posts such an infected file to the Internet. An unsuspecting user downloads the file and opens it with a vulnerable application. A malicious process connects to rogue systems on the Internet and downloads additional payloads on the user's system. Firewalls generally do a much better job of preventing inbound malicious connections from the Internet than they do of preventing outbound malicious connections to the internet.

舉例來說,假設攻擊者將這樣一個受感染的檔案發布到網際網路上。不知情的使用者下載該檔案並以有弱點的應用程式開啟它。惡意程序便會連線到網際網路上的惡意系統,並將額外的酬載下載到使用者的系統上。防火牆通常在防止來自網際網路的入向惡意連線方面表現得比防止到網際網路的出向惡意連線好得多。

What is a vulnerability that is susceptible to a buffer overflow attack?以下哪一項是容易受到緩衝區溢位攻擊影響的弱點?