Skip to content

Fix crash and security defects in four packages#5080

Open
arsenyinfo wants to merge 2 commits intomainfrom
fix/security-and-crash-defects
Open

Fix crash and security defects in four packages#5080
arsenyinfo wants to merge 2 commits intomainfrom
fix/security-and-crash-defects

Conversation

@arsenyinfo
Copy link
Copy Markdown
Contributor

Summary

  • libs/sync/gitignore.go: Add missing return after debug log on non-ErrExist open failure — prevents nil *os.File dereference (crash)
  • bundle/direct/dresources/util.go: Replace bare type assertion err.(*retries.Err) with errors.As — prevents panic on wrapped/foreign error types during reconciliation
  • cmd/labs/unpack/zipball.go: Guard against empty-zip panic (zipReader.File[0] on empty archive), zip slip path traversal (unchecked filepath.Join), and untrusted archive mode bits (zf.Mode() honored as-is including setuid/world-writable)
  • experimental/aitools/cmd/discover_schema.go: Validate table name parts against ^[A-Za-z_][A-Za-z0-9_]*$ and backtick-quote identifiers — prevents SQL injection via user/agent-supplied table names

Test plan

  • CI passes (unit tests, lint)
  • Verify databricks labs install still works with valid GitHub zipballs
  • Verify discover-schema rejects malformed table names like a.b.c; DROP TABLE x

- libs/sync/gitignore.go: add missing return after log on open failure,
  preventing nil pointer dereference on non-ErrExist errors
- bundle/direct/dresources/util.go: replace bare type assertion with
  errors.As to prevent panic on wrapped/foreign error types
- cmd/labs/unpack/zipball.go: guard against empty zip panic, zip slip
  path traversal, and untrusted archive mode bits
- experimental/aitools/cmd/discover_schema.go: validate and quote SQL
  identifiers to prevent injection via table name argument
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