Skip to content

include other claude rules#2538

Merged
renuka-fernando merged 1 commit into
wso2:mainfrom
tharindu1st:rules
Jul 22, 2026
Merged

include other claude rules#2538
renuka-fernando merged 1 commit into
wso2:mainfrom
tharindu1st:rules

Conversation

@tharindu1st

Copy link
Copy Markdown
Contributor

include other claude rules

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@tharindu1st, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ba6a8f13-5188-4020-8952-4a798c430fdb

📥 Commits

Reviewing files that changed from the base of the PR and between dbf30ee and d0e9572.

📒 Files selected for processing (9)
  • .claude/rules/authentication_authorization.md
  • .claude/rules/file-access.md
  • .claude/rules/js-authentication-authorization.md
  • .claude/rules/js-file-access.md
  • .claude/rules/js-output-encoding-xss.md
  • .claude/rules/js-ssrf-prevention.md
  • .claude/rules/js-xxe-xml-processing.md
  • .claude/rules/ssrf-prevention.md
  • .claude/rules/xxe-xml-processing.md
📝 Walkthrough

Walkthrough

This PR adds and extends .claude/rules/* security documentation for Go and JavaScript, covering authentication, file access, XSS, SSRF, and XXE prevention. The documents include directives, anti-patterns, compliant examples, and verification checklists. No source code or exported entities are changed.

Changes

Security rules documentation

Layer / File(s) Summary
Go authentication and authorization
.claude/rules/authentication_authorization.md
Adds GO-AUTH-007 through GO-AUTH-010 for endpoint authorization, parameterized SQL, token/session revocation, and redirect allowlisting.
Go file access hardening
.claude/rules/file-access.md
Adds content-sniffed upload allowlisting and sandboxed script execution requirements.
Go SSRF prevention
.claude/rules/ssrf-prevention.md
Adds dial-time validation, redirect re-validation, webhook checks, and bounded delivery guidance.
Go XXE processing
.claude/rules/xxe-xml-processing.md
Adds DOCTYPE rejection, XML resource limits, parse deadlines, and bundled-schema validation.
JavaScript authentication and authorization
.claude/rules/js-authentication-authorization.md
Adds JS-AUTH-007 through JS-AUTH-010 for Express authorization, Sequelize binding, session/JWT revocation, and redirect allowlisting.
JavaScript file access hardening
.claude/rules/js-file-access.md
Adds upload sniffing, SVG hardening, and restrictions on compiling or executing uploaded content.
JavaScript output encoding and XSS prevention
.claude/rules/js-output-encoding-xss.md
Adds contextual encoding, sanitization, SVG handling, upload validation, and response hardening guidance.
JavaScript SSRF prevention
.claude/rules/js-ssrf-prevention.md
Adds scheme and IP validation, redirect controls, request bounds, and generic rejection handling.
JavaScript XXE processing
.claude/rules/js-xxe-xml-processing.md
Adds parser hardening, DOCTYPE rejection, resource limits, worker timeouts, and bundled-schema validation.

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested reviewers: pubudu538, malinthaprasan, lasanthas, tgtshanika, chamilaadhi

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is just a placeholder and omits every required template section, so it does not describe the change. Fill in the template sections: Purpose, Goals, Approach, User stories, Documentation, tests, Security checks, Samples, Related PRs, and Test environment.
Title check ❓ Inconclusive The title is too vague to clearly summarize the main change in the pull request. Use a concise title that names the concrete change, such as adding or updating specific Claude rule documents.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 7

🧹 Nitpick comments (3)
.claude/rules/js-output-encoding-xss.md (1)

27-29: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Scope the CSP example to the portal's current CDN-backed assets.

A literal script-src 'self' example conflicts with the existing CDN script whitelist in portals/developer-portal/src/utils/util.js:700-720, so copying it as-is would break pages that still load those assets. Either call out that the example assumes self-hosted scripts, or list the required hashes/origins for the current model.

As shown in portals/developer-portal/src/utils/util.js:700-720, the current asset-loading contract still depends on CDN scripts.

Also applies to: 136-149

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/rules/js-output-encoding-xss.md around lines 27 - 29, Scope the CSP
guidance in the JS output encoding doc so it matches the portal’s current
CDN-backed asset model rather than implying a blanket script-src 'self'
requirement. Update the CSP example in the affected section to either explicitly
say it applies only to self-hosted scripts or to include the needed CDN
origins/hashes already used by the asset-loading logic in util.js, and make sure
the wording stays consistent with the related guidance elsewhere in the
document.
.claude/rules/js-xxe-xml-processing.md (1)

22-24: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Don’t present stopNodes as a depth limit.

This reads like fast-xml-parser has a real nesting-cap option here, but that may not be what the API actually provides. Please verify the parser docs and reword this to a genuine depth cap or the manual depth-walk / worker-timeout fallback unless the library confirms a real limit.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/rules/js-xxe-xml-processing.md around lines 22 - 24, The XML parsing
guidance currently treats fast-xml-parser stopNodes as if it were a
nesting-depth limit, which may be inaccurate. Reword the Depth Ceiling section
in js-xxe-xml-processing.md to reference only a real parser depth-cap if the
library docs confirm one; otherwise instruct implementers to add a manual
depth-tracking validation pass before parsing or use a worker-thread timeout
fallback. Ensure the guidance stays aligned with the symbols and concepts in the
existing file, especially the parser depth and parse-timeout recommendations.
.claude/rules/xxe-xml-processing.md (1)

85-89: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Show a config-backed ceiling in the example.

maxDocBytes is hardcoded here even though the rule says the XML byte ceiling must come from config. A reader can copy this sample verbatim and silently violate the policy. Please inject the configured limit here instead of baking 5 << 20 into the example.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/rules/xxe-xml-processing.md around lines 85 - 89, The example for
the XML parser settings hardcodes the document byte ceiling instead of showing
the config-backed value required by the rule. Update the snippet around the
maxDocBytes constant to reference the configured limit used by the real call
sites, keeping maxElemDepth and parseTimeout as-is, so readers copy an example
that matches the policy and symbols like maxDocBytes remain clearly tied to
configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/rules/authentication_authorization.md:
- Around line 632-643: The safeRedirectTarget helper currently accepts host-less
opaque URLs, which can still produce unsafe redirect locations. Update
safeRedirectTarget to only allow path-only targets by requiring an empty scheme
and opaque component in addition to no host and no leading "//", and only return
success when the parsed value starts with "/". Keep the validation and return
logic inside safeRedirectTarget consistent so malformed or non-path URLs are
rejected before being used as a redirect target.

In @.claude/rules/js-authentication-authorization.md:
- Around line 603-614: The authMiddleware example calls jwtVerify(token, ...)
before token is defined, so make the snippet copy-pastable by extracting the
bearer token from req.headers.authorization first and binding it to token before
verification. Update authMiddleware to parse the Authorization header, validate
the Bearer format, then pass the extracted token into jwtVerify while keeping
the existing User.findByPk and req.user assignment logic unchanged.

In @.claude/rules/js-file-access.md:
- Around line 254-262: The icon upload handler reads req.file.buffer before
checking whether a file was actually uploaded, so the route can throw when
upload.single('icon') reaches it without a file. Update the /apis/:id/icon
handler to guard req.file at the start of the async callback before calling
validateUploadContent or ApiIcon.create, and return a generic 400/422 response
when missing; use the existing route handler and req.file reference to place the
fix.

In @.claude/rules/js-ssrf-prevention.md:
- Around line 130-146: The import in the spec URL handler is pulling
assertAllowedScheme from the wrong module, so the example will break when
reused. Update the import in the /api/specs/import-from-url handler to get
assertAllowedScheme from ssrfGuard.js and keep safeHttpClient from
safeHttpClient.js, so the scheme check and the fetch both reference the correct
symbols.
- Line 19: The reserved-range denylist in the SSRF prevention rules contains an
incorrect loopback CIDR example, so update the “Deny Reserved Ranges” entry to
use the proper loopback range instead of 127.0.0.0/0. Fix the list in the
js-ssrf-prevention guidance so the IPv4 loopback CIDR is accurate and the
examples remain safe and correct alongside the other reserved ranges.
- Around line 91-124: The scheme check in assertAllowedScheme currently allows
plain http: by default, which should be opt-in instead. Update
assertAllowedScheme so http: is rejected unless an explicit allowHttp flag is
passed, while still allowing https: and preserving the existing statusCode
behavior for disallowed schemes. Keep the change localized to the URL parsing
logic in assertAllowedScheme and its callers, including safeHttpClient if
needed.

In @.claude/rules/ssrf-prevention.md:
- Line 19: The SSRF deny-list example in the reserved ranges guidance uses an
incorrect loopback CIDR, which would match every IPv4 address instead of just
loopback. Update the reserved-range list in the SSRF prevention rule to use the
correct loopback block, and keep the rest of the deny-list examples in line with
the intended semantics for private, loopback, link-local, and metadata
destinations.

---

Nitpick comments:
In @.claude/rules/js-output-encoding-xss.md:
- Around line 27-29: Scope the CSP guidance in the JS output encoding doc so it
matches the portal’s current CDN-backed asset model rather than implying a
blanket script-src 'self' requirement. Update the CSP example in the affected
section to either explicitly say it applies only to self-hosted scripts or to
include the needed CDN origins/hashes already used by the asset-loading logic in
util.js, and make sure the wording stays consistent with the related guidance
elsewhere in the document.

In @.claude/rules/js-xxe-xml-processing.md:
- Around line 22-24: The XML parsing guidance currently treats fast-xml-parser
stopNodes as if it were a nesting-depth limit, which may be inaccurate. Reword
the Depth Ceiling section in js-xxe-xml-processing.md to reference only a real
parser depth-cap if the library docs confirm one; otherwise instruct
implementers to add a manual depth-tracking validation pass before parsing or
use a worker-thread timeout fallback. Ensure the guidance stays aligned with the
symbols and concepts in the existing file, especially the parser depth and
parse-timeout recommendations.

In @.claude/rules/xxe-xml-processing.md:
- Around line 85-89: The example for the XML parser settings hardcodes the
document byte ceiling instead of showing the config-backed value required by the
rule. Update the snippet around the maxDocBytes constant to reference the
configured limit used by the real call sites, keeping maxElemDepth and
parseTimeout as-is, so readers copy an example that matches the policy and
symbols like maxDocBytes remain clearly tied to configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 65486bdd-7a40-4e75-a773-1529a8f54940

📥 Commits

Reviewing files that changed from the base of the PR and between 95c0c5e and 2f8beb7.

📒 Files selected for processing (9)
  • .claude/rules/authentication_authorization.md
  • .claude/rules/file-access.md
  • .claude/rules/js-authentication-authorization.md
  • .claude/rules/js-file-access.md
  • .claude/rules/js-output-encoding-xss.md
  • .claude/rules/js-ssrf-prevention.md
  • .claude/rules/js-xxe-xml-processing.md
  • .claude/rules/ssrf-prevention.md
  • .claude/rules/xxe-xml-processing.md

Comment thread .claude/rules/authentication_authorization.md
Comment thread .claude/rules/js-authentication-authorization.md
Comment thread .claude/rules/js-file-access.md
Comment thread .claude/rules/js-ssrf-prevention.md Outdated
Comment thread .claude/rules/js-ssrf-prevention.md
Comment thread .claude/rules/js-ssrf-prevention.md Outdated
Comment thread .claude/rules/ssrf-prevention.md

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 7

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/rules/authentication_authorization.md:
- Around line 549-580: Make the credential invalidation transition atomic and
concurrency-safe: update LockAccountHandler and UpdateUserRoleHandler so the
account/role change and token revocation, or a durable revocation marker, commit
within the same transaction and cannot leave old credentials valid on failure or
races. In .claude/rules/js-authentication-authorization.md lines 588-590,
replace user.tokenVersion + 1 with a row-locked or atomic increment so
concurrent updates cannot reuse a version.

In @.claude/rules/js-authentication-authorization.md:
- Around line 661-672: Update safeRedirectTarget to validate that raw is a
non-empty string before constructing the URL or calling startsWith; return '/'
for arrays, objects, empty values, and other non-string inputs, while preserving
the existing relative-target handling for valid strings.

In @.claude/rules/js-output-encoding-xss.md:
- Around line 153-157: Update the SVG upload verification checklist to remove
any implication that X-Content-Type-Options: nosniff alone is sufficient.
Require SVG-aware sanitization together with Content-Disposition: attachment or
serving from a separate cookie-less origin, and retain nosniff only as
additional defense in depth.
- Around line 114-118: Update the POST /apis/:id/icon handler to stop relying on
req.file.mimetype for content validation or response metadata. Sniff the
uploaded bytes server-side, validate that the detected format matches the
declared type, reject mismatches and unsupported formats, and sanitize SVG
content before persisting it. Persist only the validated MIME type alongside the
validated data for later Content-Type responses.

In @.claude/rules/js-ssrf-prevention.md:
- Around line 76-79: Add the IPv6 unique-local CIDR fc00::/7 to DENIED_CIDRS in
.claude/rules/js-ssrf-prevention.md (lines 76-79) and deniedCIDRs in
.claude/rules/ssrf-prevention.md (lines 93-96), and extend both SSRF rule test
guidance with IPv6 unique-local address variants.

In @.claude/rules/ssrf-prevention.md:
- Around line 142-154: The SafeHTTPClient CheckRedirect callback must not follow
unvalidated redirect targets. Update CheckRedirect to disable redirects with
http.ErrUseLastResponse, or validate each req.URL against the original host
allowlist and HTTPS policy before returning nil; preserve the existing redirect
limit only if redirects remain enabled.

In @.claude/rules/xxe-xml-processing.md:
- Around line 112-125: Update the ParseXML flow around decodeWithDepthLimit so a
timeout cancels or bounds the underlying XML parsing work instead of merely
returning while the worker continues. Use a genuinely cooperative cancellable
parser, or a bounded worker mechanism that prevents timed-out parses from
accumulating indefinitely, while preserving the existing timeout error behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5c982082-0a6e-45e5-8316-200177ca11c7

📥 Commits

Reviewing files that changed from the base of the PR and between 2f8beb7 and 813ce6c.

📒 Files selected for processing (9)
  • .claude/rules/authentication_authorization.md
  • .claude/rules/file-access.md
  • .claude/rules/js-authentication-authorization.md
  • .claude/rules/js-file-access.md
  • .claude/rules/js-output-encoding-xss.md
  • .claude/rules/js-ssrf-prevention.md
  • .claude/rules/js-xxe-xml-processing.md
  • .claude/rules/ssrf-prevention.md
  • .claude/rules/xxe-xml-processing.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • .claude/rules/js-xxe-xml-processing.md
  • .claude/rules/js-file-access.md
  • .claude/rules/file-access.md

Comment thread .claude/rules/authentication_authorization.md
Comment thread .claude/rules/js-authentication-authorization.md
Comment thread .claude/rules/js-output-encoding-xss.md Outdated
Comment thread .claude/rules/js-output-encoding-xss.md
Comment thread .claude/rules/ssrf-prevention.md Outdated
Comment thread .claude/rules/xxe-xml-processing.md Outdated
Krishanx92
Krishanx92 previously approved these changes Jul 21, 2026

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 5

♻️ Duplicate comments (1)
.claude/rules/authentication_authorization.md (1)

576-583: 🔒 Security & Privacy | 🟠 Major

Keep revocation failure handling consistent with the rule.

The example treats RevokeAllForUser as best-effort and still returns 204, while the checklist requires revocation failure to fail the operation. Either make the durable marker authoritative for every credential type, or make session/token cleanup durable and fail the handler when it cannot complete.

Also applies to: 617-620

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/rules/authentication_authorization.md around lines 576 - 583, Update
the handler around RevokeAllForUser so revocation failures do not return
http.StatusNoContent: make session/token cleanup durable and return the rule’s
required failure response when it cannot complete, or ensure the durable
token_version marker is authoritative for every credential type before retaining
best-effort cleanup. Apply the same behavior to the corresponding revocation
path noted at lines 617-620.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/rules/authentication_authorization.md:
- Around line 585-600: Update UpdateUserRoleHandler to enforce GO-AUTH-007
caller-scope authorization before beginning the role-changing transaction, then
validate newRole against the permitted role allowlist and transition rules
before executing the accounts update. Reject unauthorized callers and invalid
role transitions without modifying the database.

In @.claude/rules/js-output-encoding-xss.md:
- Around line 124-140: Guard the upload handler before accessing req.file.buffer
by returning a controlled 4xx response when req.file is absent. In the icon
retrieval flow, validate the icon record before dereferencing icon.mimeType and
return 404 when no icon exists; preserve the existing response behavior for
valid records.

In @.claude/rules/js-ssrf-prevention.md:
- Around line 76-80: Extend the reserved-range denylists to reject unspecified
destinations in both SSRF implementations: add the unspecified IPv4 and IPv6
CIDRs to DENIED_CIDRS in .claude/rules/js-ssrf-prevention.md at lines 76-80 and
to deniedCIDRs in .claude/rules/ssrf-prevention.md at lines 93-97.
- Around line 82-87: Update isDenied to convert IPv4-mapped IPv6 addresses to
their IPv4 representation before comparing address kinds and matching
DENIED_CIDRS, while preserving normal IPv6 handling. Add regression tests
covering mapped loopback and private addresses to verify they are denied by the
corresponding IPv4 ranges.

In @.claude/rules/xxe-xml-processing.md:
- Around line 95-113: Update ParseXML so the parseTimeout context is created
before io.ReadAll, ensuring the deadline covers input reading as well as
parsing. Replace the current raw reader flow with the established context-aware
or bounded reader mechanism, and preserve the existing maxDocBytes limit and
read-error handling.

---

Duplicate comments:
In @.claude/rules/authentication_authorization.md:
- Around line 576-583: Update the handler around RevokeAllForUser so revocation
failures do not return http.StatusNoContent: make session/token cleanup durable
and return the rule’s required failure response when it cannot complete, or
ensure the durable token_version marker is authoritative for every credential
type before retaining best-effort cleanup. Apply the same behavior to the
corresponding revocation path noted at lines 617-620.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d4a5dddc-c121-4372-9cfd-e0190d50de83

📥 Commits

Reviewing files that changed from the base of the PR and between 813ce6c and 16c8801.

📒 Files selected for processing (9)
  • .claude/rules/authentication_authorization.md
  • .claude/rules/file-access.md
  • .claude/rules/js-authentication-authorization.md
  • .claude/rules/js-file-access.md
  • .claude/rules/js-output-encoding-xss.md
  • .claude/rules/js-ssrf-prevention.md
  • .claude/rules/js-xxe-xml-processing.md
  • .claude/rules/ssrf-prevention.md
  • .claude/rules/xxe-xml-processing.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • .claude/rules/file-access.md
  • .claude/rules/js-file-access.md
  • .claude/rules/js-xxe-xml-processing.md

Comment thread .claude/rules/authentication_authorization.md
Comment thread .claude/rules/js-output-encoding-xss.md
Comment thread .claude/rules/js-ssrf-prevention.md
Comment thread .claude/rules/js-ssrf-prevention.md
Comment thread .claude/rules/xxe-xml-processing.md Outdated

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

♻️ Duplicate comments (1)
.claude/rules/authentication_authorization.md (1)

576-581: 🔒 Security & Privacy | 🟠 Major

Do not treat session revocation as best effort.

The handler logs RevokeAllForUser failure and still returns success. token_version only invalidates paths that check it; active session records can remain usable. Make revocation durable/atomic with the state change, or fail the operation when cleanup fails. This repeats the previously reported revocation gap.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/rules/authentication_authorization.md around lines 576 - 581, The
handler must not continue successfully when RevokeAllForUser fails. Update the
flow around tokenStore.RevokeAllForUser to make revocation atomic with the
token_version state change where supported, or propagate the error and return a
failure response, ensuring the state change is rolled back or not committed when
cleanup cannot complete.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/rules/authentication_authorization.md:
- Around line 690-707: Reject userinfo in both safe redirect implementations: in
safeRedirectTarget, require u.User == nil before returning an allowlisted
absolute HTTPS redirect; in .claude/rules/js-authentication-authorization.md
lines 667-682, reject parsed URLs with non-empty username or password before
accepting the absolute redirect. Preserve existing relative-path and host
allowlist checks.

In @.claude/rules/js-ssrf-prevention.md:
- Around line 99-105: Update guardedLookup to handle dns.lookup callbacks with
options.all enabled: when the result is an array of address/family objects,
reject if any address is denied and otherwise return the full array with the
existing callback contract. Preserve the current single-address validation and
callback behavior when options.all is false.

In @.claude/rules/xxe-xml-processing.md:
- Around line 102-149: The timeout branches in ParseXML must not return while
the read or decode goroutines can remain blocked or continue processing. Update
the readResult/readCh and errCh flows around io.ReadAll and decodeWithDepthLimit
to use cooperative cancellation and ensure each worker exits before ParseXML
returns, or isolate them with a bounded mechanism that guarantees cleanup.
Preserve the existing size checks, DOCTYPE rejection, and timeout error
behavior.

---

Duplicate comments:
In @.claude/rules/authentication_authorization.md:
- Around line 576-581: The handler must not continue successfully when
RevokeAllForUser fails. Update the flow around tokenStore.RevokeAllForUser to
make revocation atomic with the token_version state change where supported, or
propagate the error and return a failure response, ensuring the state change is
rolled back or not committed when cleanup cannot complete.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c6e09bd9-732d-451d-8bbf-1cb611b6e454

📥 Commits

Reviewing files that changed from the base of the PR and between 16c8801 and dbf30ee.

📒 Files selected for processing (9)
  • .claude/rules/authentication_authorization.md
  • .claude/rules/file-access.md
  • .claude/rules/js-authentication-authorization.md
  • .claude/rules/js-file-access.md
  • .claude/rules/js-output-encoding-xss.md
  • .claude/rules/js-ssrf-prevention.md
  • .claude/rules/js-xxe-xml-processing.md
  • .claude/rules/ssrf-prevention.md
  • .claude/rules/xxe-xml-processing.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • .claude/rules/js-xxe-xml-processing.md
  • .claude/rules/file-access.md
  • .claude/rules/js-file-access.md

Comment thread .claude/rules/authentication_authorization.md
Comment thread .claude/rules/js-ssrf-prevention.md
Comment thread .claude/rules/xxe-xml-processing.md Outdated
@renuka-fernando
renuka-fernando merged commit 1f7c109 into wso2:main Jul 22, 2026
5 of 8 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 23, 2026
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.

3 participants