harrisoncramer / harrisoncramer/ultra

Struct field mistakenly tagged secret is reported as a phantom secret

Open
#42 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2
Forks
1
Avg merge
4m
Merged PRs (30d)
1

Description

The scanner recurses into struct-typed fields and then also evaluates that field's own env and secret tags. caarlos0/env does not populate a plain struct field from a single env var (it descends into it), so a struct field tagged env and secret is a config mistake, but ultra emits the outer name as a real secret in addition to the inner fields.

run and validate then try to resolve a secret that should not exist, producing a confusing resolution failure or an empty injected variable.

A correct fix needs to only treat a struct field as a leaf when its type actually parses from a string (implements a text unmarshaler), mirroring env.Parse, which requires type information beyond the tag.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the scanner logic used by run and validate, then trace how struct fields and env/secret tags are handled alongside env.Parse. Verify the type's text-unmarshaling behavior before classifying a field as a leaf. Done means nested struct secrets remain discoverable, non-parsing outer tags do not create phantom secrets, and run/validate no longer attempt that resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.