Skip to content

Backport fix: [OCISDEV-879] disalow the 3xx redirectst for the ocm http client - #643

Merged
2403905 merged 2 commits into
stable-8.1from
backport/8.1/fix/OCISDEV-879
Jun 30, 2026
Merged

Backport fix: [OCISDEV-879] disalow the 3xx redirectst for the ocm http client#643
2403905 merged 2 commits into
stable-8.1from
backport/8.1/fix/OCISDEV-879

Conversation

@2403905

@2403905 2403905 commented Jun 30, 2026

Copy link
Copy Markdown

Backport fix: [OCISDEV-879] disalow the 3xx redirectst for the ocm http client

@kw-security

kw-security commented Jun 30, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR backports a security hardening fix for OCM by (1) preventing the OCM WebDAV HTTP client from following 3xx redirects and (2) validating that inbound OCM protocol URIs use an allowed scheme (https by default, optional http via config) before downstream code consumes them.

Changes:

  • Add a custom RoundTripper to tag outbound WebDAV requests so gowebdav inhibits following redirects.
  • Add URI scheme/host validation for OCM share-create protocols, with a new allow_http config toggle.
  • Add unit tests for URI scheme validation and a changelog entry.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/ocm/storage/received/ocm.go Wrap WebDAV transport to inhibit redirects; introduce a custom HTTP transport configuration.
internal/http/services/ocmd/shares.go Validate URI schemes for protocol fields during CreateShare request parsing; wire allow_http into handler.
internal/http/services/ocmd/scheme_test.go Add unit tests for validateURIScheme.
internal/http/services/ocmd/protocols.go Implement validateURIScheme helper for https/http-only URI validation.
internal/http/services/ocmd/ocm.go Add allow_http configuration field.
changelog/unreleased/fix-ocm-validation.md Document the fix in the changelog.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/http/services/ocmd/shares.go
Comment thread pkg/ocm/storage/received/ocm.go
Comment thread changelog/unreleased/fix-ocm-validation.md
Comment thread pkg/ocm/storage/received/ocm.go
@2403905
2403905 merged commit b9073ec into stable-8.1 Jun 30, 2026
17 checks passed
@2403905
2403905 deleted the backport/8.1/fix/OCISDEV-879 branch June 30, 2026 09:57
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.

5 participants