Skip to content

fix(orc8r): Stop web-inject attack on N/W creation#15321

Merged
panyogesh merged 3 commits intomasterfrom
topic/sec-issues/allow-net-type
Nov 6, 2023
Merged

fix(orc8r): Stop web-inject attack on N/W creation#15321
panyogesh merged 3 commits intomasterfrom
topic/sec-issues/allow-net-type

Conversation

@moinuddin1980
Copy link
Copy Markdown
Contributor

@moinuddin1980 moinuddin1980 commented Oct 12, 2023

fix(orc8r): Stop web-inject attack on N/W creation

Summary

  • Whitelisted Network types to prevent web injection attacks,
  • first, it will sanitize the input based on network type, if the client sends some malicious script to perform some attacks it will throw the error and exit the code.
  • The only allowed Network Types are LTE, FEG_LTE, CWF, FEG,

Test Plan

Tested manually by sending some web-inject script it filters the input and gives error

@moinuddin1980 moinuddin1980 requested a review from a team as a code owner October 12, 2023 04:37
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines. label Oct 12, 2023
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for opening a PR! 💯

A couple initial guidelines

Howto

  • Reviews. The "Reviewers" listed for this PR are the Magma maintainers who will shepherd it.
  • Checks. All required CI checks must pass before merge.
  • Merge. Once approved and passing CI checks, use the ready2merge label to indicate the maintainers can merge your PR.

More info

Please take a moment to read through the Magma project's

If this is your first Magma PR, also consider reading

@github-actions github-actions bot added the component: nms NMS-related issue label Oct 12, 2023
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 12, 2023

✔️ The Semantic PR check ended with status success. See instructions on formatting your commit and pull request titles.

Comment thread nms/server/network/routes.ts Outdated
if (!allowedNetworkTypes.includes(data.networkType)) {
res
.status(400)
.send(`please provide a valid network type like: LTE, FEG_LTE, CWF or FEG`)
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.

🚫 [eslint] <prettier/prettier> reported by reviewdog 🐶
Replace please·provide·a·valid·network·type·like:·LTE,·FEG_LTE,·CWF·or·FEG with ⏎············please·provide·a·valid·network·type·like:·LTE,·FEG_LTE,·CWF·or·FEG,⏎··········

Suggested change
.send(`please provide a valid network type like: LTE, FEG_LTE, CWF or FEG`)
.send(
`please provide a valid network type like: LTE, FEG_LTE, CWF or FEG`,
)

Copy link
Copy Markdown
Contributor

@lucasgonze lucasgonze left a comment

Choose a reason for hiding this comment

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

LGTM

@moinuddin1980 moinuddin1980 changed the title fix(NMS): Stop web-inject attack on N/W creation fix(orc8r): Stop web-inject attack on N/W creation Oct 25, 2023
@moinuddin1980 moinuddin1980 force-pushed the topic/sec-issues/allow-net-type branch from b8d657e to 44d6d31 Compare October 27, 2023 14:58
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines. and removed size/XS Denotes a PR that changes 0-9 lines. labels Oct 30, 2023
@panyogesh panyogesh enabled auto-merge (squash) November 2, 2023 06:00
Copy link
Copy Markdown
Contributor

@panyogesh panyogesh left a comment

Choose a reason for hiding this comment

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

LGTM

@moinuddin1980 moinuddin1980 force-pushed the topic/sec-issues/allow-net-type branch from 94bca1e to a1059e3 Compare November 6, 2023 07:28
Copy link
Copy Markdown
Member

@maxhbr maxhbr left a comment

Choose a reason for hiding this comment

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

after a brief look at the code: seems to be sane and OK.

I did not test or verify the code.

@panyogesh panyogesh merged commit dd42de5 into master Nov 6, 2023
@panyogesh panyogesh deleted the topic/sec-issues/allow-net-type branch November 6, 2023 08:22
lucasgonze pushed a commit to lucasgonze/magma that referenced this pull request Feb 29, 2024
* Whitelist Net type to prevent web inject attack

Signed-off-by: jahid-wavelabs <[email protected]>

* Whitelist N/W type to prevent web inject attack

Signed-off-by: jahid-wavelabs <[email protected]>

* Whitelist N/W type to prevent web inject attack

Signed-off-by: jahid-wavelabs <[email protected]>

---------

Signed-off-by: jahid-wavelabs <[email protected]>
Co-authored-by: jahid-wavelabs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: nms NMS-related issue size/S Denotes a PR that changes 10-29 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants