Skip to content

feat: update scim/core to implement RFC-7643 - #2746

Open
xlgmokha wants to merge 2 commits into
masterfrom
scim/2-core
Open

feat: update scim/core to implement RFC-7643#2746
xlgmokha wants to merge 2 commits into
masterfrom
scim/2-core

Conversation

@xlgmokha

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Feature. Implements RFC-7643 SCIM Core Schema.

What is the current behavior?

What is the new behavior?

Additional context

Extracted from #2731

@xlgmokha
xlgmokha changed the base branch from master to scim/1-migrations August 26, 2026 00:57
@xlgmokha xlgmokha self-assigned this Aug 26, 2026
@xlgmokha
xlgmokha marked this pull request as ready for review August 26, 2026 01:01
@xlgmokha
xlgmokha requested a review from a team as a code owner August 26, 2026 01:01
@xlgmokha
xlgmokha force-pushed the scim/2-core branch 2 times, most recently from 11e0e54 to ee648cd Compare August 26, 2026 18:53
@blacksmith-sh

This comment has been minimized.

@xlgmokha
xlgmokha marked this pull request as draft August 26, 2026 21:52
@xlgmokha
xlgmokha force-pushed the scim/2-core branch 2 times, most recently from fec7a7d to 218f257 Compare August 26, 2026 23:31
@xlgmokha
xlgmokha marked this pull request as ready for review August 27, 2026 00:26
@xlgmokha
xlgmokha force-pushed the scim/2-core branch 3 times, most recently from 7ce31be to a9ac782 Compare August 27, 2026 17:10
Base automatically changed from scim/1-migrations to master August 27, 2026 17:11

func (m Meta) For(resource Resource) Meta {
created, updated := resource.Timestamps()
m.Location = Join(m.Location, resource.ResourceID())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Severity: LOW

resource.ResourceID() is copied into the SCIM meta.location URL as a raw path fragment. A client- or directory-derived identifier containing /, ?, #, or .. can change the referenced path or query, causing SCIM consumers following this location to request an unintended resource or operation.
Helpful? Add 👍 / 👎

💡 Fix Suggestion

Suggestion: URL-encode the resource ID before appending it to the SCIM meta.location URL to prevent path traversal and URL manipulation via special characters. Use url.PathEscape(resource.ResourceID()) at line 23, and also expand the import at line 3 to include "net/url" alongside "time". url.PathEscape will percent-encode characters such as /, ?, #, and .. so they are treated as literal data in the path segment rather than URL structure.

⚠️ Experimental Feature: This code suggestion is automatically generated. Please review carefully.

Suggested change
m.Location = Join(m.Location, resource.ResourceID())
m.Location = Join(m.Location, url.PathEscape(resource.ResourceID()))

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