Skip to content

[Security Issue] Avoid Exposing Ports without Authentication - #5442

Merged
code-asher merged 3 commits into
coder:mainfrom
rafaelcalpena:patch-2
Aug 11, 2022
Merged

code-asher merged 3 commits into
coder:mainfrom
rafaelcalpena:patch-2

Conversation

@rafaelcalpena

Copy link
Copy Markdown

Hi, I have recently started using code-server and the proxy feature is very handy, however I realized that anyone can access proxied ports on public domains. The authenticated call seems to be working correctly, but the proxy function does not wait asynchronously for the authentication result.

I believe this is a high-priority issue with consequences such as disclosure of unwanted data and potential priviledge escalation on the system. I have not tested my fix, but only minor changes were necessary, so it should be ready to go.

`proxy` should `await` for result of `authenticated` call to avoid security issues.
@rafaelcalpena
rafaelcalpena requested a review from a team August 10, 2022 22:08

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!! This is definitely a big deal. @jsjoeio we should probably try releasing soon with this fix.

@jsjoeio

jsjoeio commented Aug 10, 2022

Copy link
Copy Markdown
Contributor

Big thank you for finding and fixing @rafaelcalpena!

we should probably try releasing soon with this fix.

Agreed!

@codecov

codecov Bot commented Aug 10, 2022

Copy link
Copy Markdown

Codecov Report

Merging #5442 (fbbe776) into main (c69f2c6) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5442   +/-   ##
=======================================
  Coverage   72.44%   72.44%           
=======================================
  Files          30       30           
  Lines        1673     1673           
  Branches      366      366           
=======================================
  Hits         1212     1212           
  Misses        398      398           
  Partials       63       63           
Impacted Files Coverage Δ
src/node/routes/index.ts 80.80% <100.00%> (ø)
src/node/routes/pathProxy.ts 66.66% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c69f2c6...fbbe776. Read the comment docs.

@rafaelcalpena

Copy link
Copy Markdown
Author

Thanks @code-asher and @jsjoeio for merging and releasing this!

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