Skip to content

fix: add timeout to awsenv.Ensure and support value type input in EncryptStruct/DecryptStruct#8

Merged
dorothyyzh merged 5 commits intomainfrom
fix-bug
Mar 17, 2026
Merged

fix: add timeout to awsenv.Ensure and support value type input in EncryptStruct/DecryptStruct#8
dorothyyzh merged 5 commits intomainfrom
fix-bug

Conversation

@iBakuman
Copy link
Copy Markdown
Contributor

Changes

awsenv: add configurable timeout to Ensure

  • Add Option pattern with WithTimeout (default 10s)
  • Thread context through all internal operations (exec.CommandContext, TryLockContext, STS calls)
  • Return a clear error on timeout hinting at possible network issues

manager: support value type (non-pointer) input in EncryptStruct/DecryptStruct

  • EncryptStruct and DecryptStruct now accept both value types and pointer types
  • Always clear sensitive fields after encryption (including top-level, not just nested)
  • Add value_type_input test case

Comment thread awsenv/awsenv.go
func runOidc2aws(alias string) (string, error) {
cmd := exec.Command("oidc2aws", "-login", "-alias", alias, "--env")
func runOidc2aws(ctx context.Context, alias string) (string, error) {
cmd := exec.CommandContext(ctx, "oidc2aws", "-login", "-alias", alias, "--env")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible command injection via shell script - medium severity
Your code spawns a subprocess via a shell script. User input could be abused to inject extra commands.

Show fix

Remediation: This issue can be mitigated or ignored if you verified or sanitized the user input used in the shell command.

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

@dorothyyzh dorothyyzh merged commit 16baf80 into main Mar 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants