Skip to content

fix(.life): binding ui_hints _ref fields path-traversal pattern (post-#111 review)#114

Merged
LING71671 merged 1 commit into
masterfrom
devin/1777219690-followup-ui-hints-path-traversal
Apr 26, 2026
Merged

fix(.life): binding ui_hints _ref fields path-traversal pattern (post-#111 review)#114
LING71671 merged 1 commit into
masterfrom
devin/1777219690-followup-ui-hints-path-traversal

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Apr 26, 2026

Summary

Sibling fix to the path-traversal tightening on providers_whitelist_ref
that landed inside #111. A new Devin Review finding on the merged
PR pointed out that surface.ui_hints.avatar_image_ref and
surface.ui_hints.background_audio_ref are also paths-inside-.life
and were left with minLength: 1 only — same defence-in-depth gap as
providers_whitelist_ref had before #111.

This PR applies the same ^(?!/)(?!.*\\.\\.).+$ pattern (cross-schema
convention shared with life-package.schema.json::contents[].path,
lifecycle.schema.json::mutation_log_ref, and the now-fixed
binding.schema.json::providers_whitelist_ref).

Changes

  • schemas/binding.schema.json: add pattern to avatar_image_ref and
    background_audio_ref under surface.ui_hints (additionalProperties: false block).
  • tools/test_binding_schema.py: 8 new cases (6 negative + 2 happy)
    per field — absolute path (/etc/passwd), parent-dir traversal
    (../etc/passwd), embedded .. segment (media/../etc/passwd), and
    one normal relative path (media/avatar.png). Total goes from 55 → 63
    (11 happy-path + 52 negative).
  • CHANGELOG.md: bump the v0.8 binding sanity-test count and explain
    the bump source.

Local validation

  • python tools/test_binding_schema.pyrun: 63 cases, failures: 0
  • python tools/batch_validate.py → 21/21 steps pass

Review & Testing Checklist for Human

Risk: green — 2-line schema tightening + 8 new sanity tests, no
behavioural change for any compliant binding (existing example bindings
already use bare relative paths).

  • Confirm the regex ^(?!/)(?!.*\\.\\.).+$ matches what
    life-package.schema.json::contents[].path and
    lifecycle.schema.json::mutation_log_ref use.
  • Confirm no shipped example or fixture file breaks (the only
    example currently using ui_hints lives inside test fixtures and
    uses disclosure_label only).

Notes

Link to Devin session: https://app.devin.ai/sessions/ff7322e18fd94887875daa2c1c75f87d
Requested by: @LING71671


Open in Devin Review

…111 review)

Sibling fix to #111's providers_whitelist_ref tightening. surface.ui_hints
.avatar_image_ref and .background_audio_ref are also paths inside the
`.life` zip and were missing the cross-schema path-traversal pattern
`^(?!/)(?!.*\.\.).+$` applied elsewhere (life-package contents[].path,
lifecycle.mutation_log_ref, binding.providers_whitelist_ref).

Tests: 8 new cases (6 negative + 2 happy) — absolute path, parent-dir
traversal, embedded `..` segment, and a normal relative path for each
of the two fields. Total 55 → 63 (11 happy-path + 52 negative).

Local validation: tools/test_binding_schema.py reports
`run: 63 cases, failures: 0`; tools/batch_validate.py 21/21 green.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@LING71671 LING71671 merged commit 903de28 into master Apr 26, 2026
5 checks passed
devin-ai-integration Bot added a commit that referenced this pull request Apr 26, 2026
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.

1 participant