Skip to content

Commit c2755df

Browse files
committed
Revert "fix(describe): read IsPasswordBox through a named accessor"
This reverts 3ac6df5. The hypothesis behind it — that CodeQL read the inline `w["IsPasswordBox"]` map index as a credential lookup — was wrong: the re-run produced a byte-identical alert, and running the query locally shows the source is `modelsdk/gen/pages/types.go:33658`, the `o.isPasswordBox` property descriptor in the generated SetProperties slice. The alert reproduces on unmodified main (codeql 2.27.0, Security/CWE-312/CleartextLogging.ql, 6 results including this exact one), so it is not this branch's to fix, and the accessor bought nothing. Keeping the PR scoped to #550. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L2aYb3zDscezm874CDTH6R
1 parent 3ac6df5 commit c2755df

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

‎mdl/executor/cmd_pages_describe_parse.go‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ func parseRawWidget(ctx *ExecContext, w map[string]any, parentEntityContext ...s
331331
widget.Content = extractAttributeRef(ctx, w)
332332
widget.Placeholder = extractPlaceholderText(ctx, w)
333333
widget.Editable = extractEditable(ctx, w)
334-
widget.IsPassword = widgetBoolProperty(w, "IsPasswordBox")
334+
widget.IsPassword, _ = w["IsPasswordBox"].(bool)
335335
widget.ValidationExpression, widget.ValidationMessage = extractWidgetValidation(ctx, w)
336336
widget.OnChange = extractOnChangeAction(ctx, w)
337337
return []rawWidget{widget}
@@ -930,20 +930,6 @@ func extractWidgetValidation(ctx *ExecContext, w map[string]any) (expression, me
930930

931931
// extractReadOnlyStyle extracts the ReadOnlyStyle from an input widget.
932932
// Returns "Inherit", "Control", or "Text".
933-
// widgetBoolProperty reads a boolean property off a widget document.
934-
//
935-
// The key is a parameter rather than an inline index, which is not cosmetic:
936-
// CodeQL's clear-text-logging query treats w["IsPasswordBox"] as a lookup of a
937-
// credential and then follows the boolean into every error the page writer can
938-
// return, failing the build on an unrelated example's fmt.Printf of that error
939-
// (ako/mxcli#550). IsPasswordBox is a design-time flag — "render this text box
940-
// as a password field" — and holds no secret, so the classification is wrong at
941-
// the source rather than at the sink.
942-
func widgetBoolProperty(w map[string]any, key string) bool {
943-
v, _ := w[key].(bool)
944-
return v
945-
}
946-
947933
func extractReadOnlyStyle(ctx *ExecContext, w map[string]any) string {
948934
if style, ok := w["ReadOnlyStyle"].(string); ok {
949935
return style

0 commit comments

Comments
 (0)