Conversation
Forward webconfig notifications without filtering
…ons-all Forward webconfig notifications without filtering
generate notifications if states are corrected by versions from devices
revise bitmap test codes
generate notifications if states are corrected by versions from devices
Return 504 if xconf GET returns timeout/context_cancellation
Add debug loggings for 403 error analysis
Add debug loggings for 403 error analysis
Add debug loggings for 403 error analysis
Cherrypick log403
return 404 for NONE-REBOOT without subdocs
return 404 for NONE-REBOOT without subdocs
Update the sample Cassandra configuration to use a non-SSL connection
…nnection" This reverts commit 1e2d01c.
Revert "Update the sample Cassandra configuration to use a non-SSL co…
Add cassandra config for tls as we upgraded the dependency libs in go…
Add tls configs to work with a targeted cassandra env
Fix a bug that wronge hocon paths wwere used to read kafka tls configs
Add back cassandra ciphersuite configs removed by mistake
…document columns product_class and customer_type
Store new headers X-System-Product-Class and X-System-Type into root_…
| firmwareVersion := rHeader.Get(common.HeaderFirmwareVersion) | ||
| firmwareVersion, err := rHeader.Get(common.HeaderFirmwareVersion) | ||
| if err != nil { | ||
| log.WithFields(tfields).Warn(err) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 months ago
In general, the fix is to ensure that values derived from HTTP request headers are not logged in clear text when they may be sensitive or attacker-controlled. Instead of constructing error messages that embed the full header value, log only metadata (such as header name) or, if needed, a redacted/obfuscated form of the value. This keeps logs useful for debugging while avoiding clear-text exposure of potentially sensitive data.
The specific best fix here is to change ReqHeader.Get in common/req_header.go so that, when it detects a non-printable (invalid) value, it generates an error message that does not include %v for the raw header value. We can keep the header name and a generic description (e.g., “invalid value discarded”) and maybe the length of the value, but not the content itself. This change preserves existing behavior (invalid values are still rejected with an error) and only alters the text of that error. No callers need to change: BuildGetDocument will still log the error, but without leaking the header value.
Concretely:
- In
common/req_header.go, update thefmt.Errorfcall inReqHeader.Getto dropvfrom the formatted string (or replace it with a safe summary like its length). - No changes are required in
db/service.goorhttp/multipart.go, as they will automatically benefit from the safer error message. - No new imports or methods are required; we only adjust the format string and arguments.
| @@ -35,7 +35,8 @@ | ||
| func (h *ReqHeader) Get(k string) (string, error) { | ||
| v := h.Header.Get(k) | ||
| if !IsPrintable([]byte(v)) { | ||
| return "", fmt.Errorf("header %v invalid value %v discarded", k, v) | ||
| // Do not include the raw header value in the error to avoid logging potentially sensitive data. | ||
| return "", fmt.Errorf("header %v has an invalid value and was discarded", k) | ||
| } | ||
| return v, nil | ||
| } |
…en POST new payload and state changed from 4 to 2
fix a bug that error_code and error_details columns were not reset wh…
handle failed sqlite related tests during root_document schema change
add bitmap definitions for hotspotwantolan and ignitewifi
|
b'## WARNING: A Blackduck scan failure has been waived A prior failure has been upvoted
|
Add missing code for customer_type and product_class support
rename column name from customer_type to account_type
|
|
||
| productClass, err := rHeader.Get(common.HeaderProductClass) | ||
| if err != nil { | ||
| log.WithFields(tfields).Warn(err) |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
General fix: never include raw sensitive/untrusted input in log messages or propagated errors that may be logged. For header validation, include only safe metadata (e.g., header key), not the header value.
Best targeted fix (no functional change): in common/req_header.go, update ReqHeader.Get so the returned error for non-printable input does not interpolate v. Keep return semantics unchanged (return "", error) so existing control flow and validation behavior remain intact. This single change prevents all downstream logs (including db/service.go:99) from containing clear-text header values.
Required edits:
- File:
common/req_header.go - Region:
ReqHeader.Getmethod, line withfmt.Errorf("header %v invalid value %v discarded", k, v) - Change: replace with a sanitized message like
fmt.Errorf("header %v has invalid value discarded", k)
No new methods/imports/dependencies needed.
| @@ -35,7 +35,7 @@ | ||
| func (h *ReqHeader) Get(k string) (string, error) { | ||
| v := h.Header.Get(k) | ||
| if !IsPrintable([]byte(v)) { | ||
| return "", fmt.Errorf("header %v invalid value %v discarded", k, v) | ||
| return "", fmt.Errorf("header %v has invalid value discarded", k) | ||
| } | ||
| return v, nil | ||
| } |
update dependencies based code scan advice
No description provided.