Go, Swift: Update dead link in .qhelp - #22561
Conversation
|
QHelp previews: go/ql/src/Security/CWE-312/CleartextLogging.qhelpClear-text logging of sensitive informationSensitive information that is logged unencrypted is accessible to an attacker who gains access to the logs. RecommendationEnsure that sensitive information is always encrypted or obfuscated before being logged. In general, decrypt sensitive information only at the point where it is necessary for it to be used in cleartext. Be aware that external processes often store the standard out and standard error streams of the application, causing logged sensitive information to be stored. ExampleThe following example code logs user credentials (in this case, their password) in plain text: package main
import (
"log"
"net/http"
)
func serve() {
http.HandleFunc("/register", func(w http.ResponseWriter, r *http.Request) {
r.ParseForm()
user := r.Form.Get("user")
pw := r.Form.Get("password")
log.Printf("Registering new user %s with password %s.\n", user, pw)
})
http.ListenAndServe(":80", nil)
}Instead, the credentials should be encrypted, obfuscated, or omitted entirely: package main
import (
"log"
"net/http"
)
func serve1() {
http.HandleFunc("/register", func(w http.ResponseWriter, r *http.Request) {
r.ParseForm()
user := r.Form.Get("user")
pw := r.Form.Get("password")
log.Printf("Registering new user %s.\n", user)
// ...
use(pw)
})
http.ListenAndServe(":80", nil)
}References
swift/ql/src/queries/Security/CWE-312/CleartextLogging.qhelpCleartext logging of sensitive informationAttackers could gain access to sensitive information that is logged unencrypted. RecommendationAlways make sure to encrypt or obfuscate sensitive information before you log it. Generally, you should decrypt sensitive information only at the point where it is necessary for it to be used in cleartext. Be aware that external processes often store the standard output and standard error streams of the application. This will include logged sensitive information. ExampleThe following example code logs user credentials (in this case, their password) in plaintext: let password = "P@ssw0rd"
NSLog("User password changed to \(password)")Instead, you should encrypt or obfuscate the credentials, or omit them entirely: let password = "P@ssw0rd"
NSLog("User password changed")References
|
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Both reviewed files update the dead reference with no unresolved issues.
Review tier: Lite (auto)
Findings: None
Note
Copilot is running an experiment and ran this review at Lite.
What changed in this PR
Updates the dead OWASP reference in the Go and Swift cleartext logging query help files.
Changes:
- Replaces the obsolete link with OWASP’s Logging Cheat Sheet.
- Keeps both language versions aligned.
| File | Description |
|---|---|
swift/ql/src/queries/Security/CWE-312/CleartextLogging.qhelp |
Updates the OWASP reference link. |
go/ql/src/Security/CWE-312/CleartextLogging.qhelp |
Updates the OWASP reference link. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Replace a dead link in the cleartext logging
.qhelp(two language versions).