GitHub Copilot 產生出來程式的安全性問題

看到「Encoding data for POST requests」這篇大家才回頭注意到 GitHub Copilot 首頁的範例本身就有安全漏洞:

async function isPositive(text: string): Promise<boolean> {
  const response = await fetch(`http://text-processing.com/api/sentiment/`, {
    method: "POST",
    body: `text=${text}`,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
  });
  const json = await response.json();
  return json.label === "pos";
}

其中 text=${text} 是一個 injection 類的漏洞,首頁的範例應該是被挑過的,但仍然出現了這個嚴重的問題,從這邊可以看出 GitHubOpenAI 在這條線上的問題...

Windows 7 的無線鍵盤 icon 出現麵包機 icon 的原因...

Super User 上出現這個問題:「Why does Windows think that my wireless keyboard is a toaster?」,無線鍵盤變成麵包機 XDDDDDDD

原因是出自 Microsoft 提供程式碼範例的預設值 (Sample DeviceInfo XML Data),如果廠商寫 driver 時沒改,就會變成這樣 XDDDDDDDDD