Summary
Daily make golint-custom found 23 dynamic-regexp findings where regexp patterns are not compile-time constants.
Root cause
The custom linter flags regexp construction from non-constant patterns because dynamic patterns can panic at runtime or enable ReDoS when influenced by untrusted input.
Affected paths
pkg/agentdrain/mask.go
pkg/stringutil/sanitize.go
pkg/parser/frontmatter_content.go
pkg/parser/json_path_locator.go
pkg/parser/schema_suggestions.go
pkg/cli/codemod_activation_outputs.go
pkg/cli/firewall_policy.go
pkg/workflow/gh_cli_permissions.go
pkg/workflow/mcp_renderer_guard.go
pkg/workflow/observability_otlp.go
pkg/workflow/template_injection_utils.go
pkg/workflow/yaml.go
Representative diagnostics
pkg/agentdrain/mask.go:33: regexp pattern is not a compile-time constant
pkg/stringutil/sanitize.go:168: regexp pattern is not a compile-time constant
pkg/parser/json_path_locator.go:184: regexp pattern is not a compile-time constant
pkg/parser/schema_suggestions.go:506: regexp pattern is not a compile-time constant
Expected outcome
Replace flagged dynamic regexp construction with safer alternatives such as:
- precompiled constant regexps,
- quoted literals (
regexp.QuoteMeta) combined with safe matching primitives,
- string operations when full regexp support is unnecessary,
- explicit validation paths that avoid user-influenced pattern compilation.
Remediation checklist
Generated by 🧌 LintMonster · gpt54 · 20 AIC · ⌖ 6.27 AIC · ⊞ 5.5K · ◷
Summary
Daily
make golint-customfound 23 dynamic-regexp findings where regexp patterns are not compile-time constants.Root cause
The custom linter flags regexp construction from non-constant patterns because dynamic patterns can panic at runtime or enable ReDoS when influenced by untrusted input.
Affected paths
pkg/agentdrain/mask.gopkg/stringutil/sanitize.gopkg/parser/frontmatter_content.gopkg/parser/json_path_locator.gopkg/parser/schema_suggestions.gopkg/cli/codemod_activation_outputs.gopkg/cli/firewall_policy.gopkg/workflow/gh_cli_permissions.gopkg/workflow/mcp_renderer_guard.gopkg/workflow/observability_otlp.gopkg/workflow/template_injection_utils.gopkg/workflow/yaml.goRepresentative diagnostics
pkg/agentdrain/mask.go:33: regexp pattern is not a compile-time constantpkg/stringutil/sanitize.go:168: regexp pattern is not a compile-time constantpkg/parser/json_path_locator.go:184: regexp pattern is not a compile-time constantpkg/parser/schema_suggestions.go:506: regexp pattern is not a compile-time constantExpected outcome
Replace flagged dynamic regexp construction with safer alternatives such as:
regexp.QuoteMeta) combined with safe matching primitives,Remediation checklist
make golint-custom