···11+package main
22+33+import (
44+ "flag"
55+ "os"
66+ "text/template"
77+ "time"
88+)
99+1010+var (
1111+ date = flag.String("date", time.Now().Format(time.DateOnly), "Date of the CVE")
1212+ cve = flag.String("cve", "", "CVE number")
1313+ cveLink = flag.String("cve-link", "", "CVE link")
1414+ project = flag.String("project", "", "Project name")
1515+ projectLink = flag.String("project-link", "", "Project link")
1616+ summary = flag.String("summary", "a memory safety vulnerability resulting in arbitrary code execution", "Summary of the CVE")
1717+)
1818+1919+func main() {
2020+ flag.Parse()
2121+2222+ os.MkdirAll("./lume/src/shitposts/no-way-to-prevent-this", 0755)
2323+ fout, err := os.Create("./lume/src/shitposts/no-way-to-prevent-this/" + *cve + ".md")
2424+ if err != nil {
2525+ panic(err)
2626+ }
2727+ defer fout.Close()
2828+2929+ data := map[string]string{
3030+ "Date": *date,
3131+ "CVE": *cve,
3232+ "CVELink": *cveLink,
3333+ "Project": *project,
3434+ "ProjectLink": *projectLink,
3535+ "Summary": *summary,
3636+ }
3737+3838+ tmpl := template.Must(template.New("article").Parse(articleTemplate))
3939+ if err := tmpl.Execute(fout, data); err != nil {
4040+ panic(err)
4141+ }
4242+}
4343+4444+const articleTemplate = `---
4545+title: '"No way to prevent this" says users of the only programming language where this regularly happens'
4646+date: {{.Date}}
4747+series: "no-way-to-prevent-this"
4848+type: blog
4949+hero:
5050+ ai: "Photo by Andrea Piacquadio, source: Pexels"
5151+ file: sad-business-man
5252+ prompt: A forlorn business man resting his head on a brown wall next to a window.
5353+---
5454+5555+In the hours following the release of [{{.CVE}}]({{.CVELink}}) for the project [{{.Project}}]({{.ProjectLink}}), site reliability workers
5656+and systems administrators scrambled to desperately rebuild and patch all their systems to fix {{.Summary}}. This is due to the affected components being
5757+written in C, the only programming language where these vulnerabilities regularly happen. "This was a terrible tragedy, but sometimes
5858+these things just happen and there's nothing anyone can do to stop them," said programmer Willodean Santorella, echoing statements
5959+expressed by hundreds of thousands of programmers who use the only language where 90% of the world's memory safety vulnerabilities have
6060+occurred in the last 50 years, and whose projects are 20 times more likely to have security vulnerabilities. "It's a shame, but what can
6161+we do? There really isn't anything we can do to prevent memory safety vulnerabilities from happening if the programmer doesn't want to
6262+write their code in a robust manner." At press time, users of the only programming language in the world where these vulnerabilities
6363+regularly happen once or twice per quarter for the last eight years were referring to themselves and their situation as "helpless."
6464+`
+4
dhall/seriesDescriptions.dhall
···6969 , details =
7070 "Instructions on how to use Nix flakes, a new way to use Nix in a more reproducible way."
7171 }
7272+ , Desc::{
7373+ name = "no-way-to-prevent-this",
7474+ details = "Articles about the futility of preventing memory safety vulnerabilities."
7575+ }
7276 , Desc::{ name = "nixos", details = "Nix." }
7377 , Desc::{
7478 , name = "olin"
···11+---
22+title: '"No way to prevent this" says users of the only programming language where this regularly happens'
33+date: 2024-01-30
44+series: "no-way-to-prevent-this"
55+type: blog
66+hero:
77+ ai: "Photo by Andrea Piacquadio, source: Pexels"
88+ file: sad-business-man
99+ prompt: A forlorn business man resting his head on a brown wall next to a window.
1010+---
1111+1212+In the hours following the release of [CVE-2023-6246](https://www.qualys.com/2024/01/30/cve-2023-6246/syslog.txt) for the project [GNU glibc](https://sourceware.org/glibc/), site reliability workers
1313+and systems administrators scrambled to desperately rebuild and patch all their systems to fix a heap-based buffer overflow in the syslog() function resulting in memory corruption or even arbitrary code execution when run in SUID binaries. This is due to the affected components being
1414+written in C, the only programming language where these vulnerabilities regularly happen. "This was a terrible tragedy, but sometimes
1515+these things just happen and there's nothing anyone can do to stop them," said programmer Willodean Santorella, echoing statements
1616+expressed by hundreds of thousands of programmers who use the only language where 90% of the world's memory safety vulnerabilities have
1717+occurred in the last 50 years, and whose projects are 20 times more likely to have security vulnerabilities. "It's a shame, but what can
1818+we do? There really isn't anything we can do to prevent memory safety vulnerabilities from happening if the programmer doesn't want to
1919+write their code in a robust manner." At press time, users of the only programming language in the world where these vulnerabilities
2020+regularly happen once or twice per quarter for the last eight years were referring to themselves and their situation as "helpless."