Skip to content

Fix: Prevent CORS exposure and sensitive error disclosure - #1739

Open
mertcano wants to merge 1 commit into
genlayerlabs:v0.123-devfrom
mertcano:mertcano-patch-2
Open

Fix: Prevent CORS exposure and sensitive error disclosure#1739
mertcano wants to merge 1 commit into
genlayerlabs:v0.123-devfrom
mertcano:mertcano-patch-2

Conversation

@mertcano

Copy link
Copy Markdown

This PR mitigates critical data disclosure and unauthorized origin execution vectors in the FastAPI RPC server.

Updates:

CORS Hardening: Removed the permissive allow_origins=["*"] configuration. The server now requires a comma-separated ALLOWED_ORIGINS environment variable and will strictly fail closed (RuntimeError) on startup if it is omitted. This ensures a deliberate deployment policy is always enforced.

Error Disclosure Prevention: Removed the str(exc) reflection in the /api endpoint's fallback exception handler. Provider, RPC, and internal contract state anomalies are now safely logged to the server backend while the client receives a static An unexpected server error occurred response detail.

Fixes #issue-number-here

What

  • changed thing a for b
  • also did this other unrelated thing in my path

Why

  • to fix a bug
  • to add more value to the user

Testing done

  • tested the new feature
  • tested the bug fix

Decisions made

Checks

  • I have tested this code
  • I have reviewed my own PR
  • I have created an issue for this PR
  • I have set a descriptive PR title compliant with conventional commits

Reviewing tips

User facing release notes

This PR mitigates critical data disclosure and unauthorized origin execution vectors in the FastAPI RPC server.

Updates:

CORS Hardening: Removed the permissive allow_origins=["*"] configuration. The server now requires a comma-separated ALLOWED_ORIGINS environment variable and will strictly fail closed (RuntimeError) on startup if it is omitted. This ensures a deliberate deployment policy is always enforced.

Error Disclosure Prevention: Removed the str(exc) reflection in the /api endpoint's fallback exception handler. Provider, RPC, and internal contract state anomalies are now safely logged to the server backend while the client receives a static An unexpected server error occurred response detail.
@github-actions
github-actions Bot changed the base branch from main to v0.123-dev August 15, 2026 12:13
@github-actions

Copy link
Copy Markdown
Contributor

This PR targeted main, which is only the default/static branch.

I retargeted it to v0.123-dev, the active development branch. Pushes to v0.123-dev automatically fast-forward main.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 98e771ab-f994-40be-aa05-c1bc6e7c9f1c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

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