zowe / zowe/api-layer

Services providing allowedOrigins may make Gateway fail

Open Beginner friendly
#4,858 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Priority: Medium size/S
Dominant language
Java
Stars
92
Forks
81
Avg merge
1d 9h
Merged PRs (30d)
46

Description

Describe the bug

Original conversation: https://github.com/zowe/api-layer/pull/4718#discussion_r3673842302

with corsEnabled true in Gateway, there is nothing to prevent an error in Gateway if a service provides * as allowedOrigin.

It's relatively low risk since it's not recommended to set *, but Gateway under this scenario uses allowedOrigin instead of allowedOriginPattern.

Expected behavior
If the service provides * it should use allowedOriginPattern.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Gateway's CORS handling for service-provided allowedOrigin and allowedOriginPattern values. Reproduce the case where a service returns * with corsEnabled true, then verify that Gateway uses the pattern field and no longer fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.