FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

http: check for existance in resetHeadersTimeoutOnReqEnd by mcollina · Pull Request #26402 · nodejs/node · GitHub

/ node Public

http: check for existance in resetHeadersTimeoutOnReqEnd - #26402

Closed
mcollina wants to merge 1 commit into
nodejs:masterfrom
mcollina:fix-null-check
Closed

http: check for existance in resetHeadersTimeoutOnReqEnd#26402
mcollina wants to merge 1 commit into
nodejs:masterfrom
mcollina:fix-null-check

Conversation

mcollina commented Mar 2, 2019
edited
Loading

Copy link
Copy Markdown
Member

socket.parser can be undefined under unknown circumstances.
This is a fix for a bug I cannot reproduce but it is affecting
people.

Fixes: #26366

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Copy link
Copy Markdown
Collaborator

nodejs-github-bot added the http Issues or PRs related to the http subsystem. label Mar 2, 2019
mcollina requested review from addaleax and rvagg March 2, 2019 18:11

mcollina commented Mar 2, 2019

Copy link
Copy Markdown
Member Author

cc @nodejs/http

@nodejs/lts @nodejs/release we would likely have to backport this down to 6 for safety, given that we do not know how this condition is triggered.

mcollina commented Mar 2, 2019

Copy link
Copy Markdown
Member Author

Copy link
Copy Markdown
Member

socket.parser can be undefined under unknown circumstances.
This is a fix for a bug I cannot reproduce but it is affecting
people.

Fixes: #26357

Shouldn't that be #26366? (Commit message too.)

mcollina commented Mar 2, 2019

Copy link
Copy Markdown
Member Author

@richardlau good spot! Fixed.

Trott commented Mar 2, 2019

Copy link
Copy Markdown
Member

Optional typo fix for commit title: s/existance/existence/

Trott commented Mar 2, 2019
edited
Loading

Copy link
Copy Markdown
Member

Here's a test that reproduces the error in #26366 in current master.

'use strict';

require('../common');

const http = require('http');

const server = http.createServer((req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.write('okay', () => { delete res.socket.parser });
  res.end();
});

server.listen(1337, '127.0.0.1');

const req = http.request({
  port: 1337,
  host: '127.0.0.1',
  method: 'GET',
});

req.end();

Trott commented Mar 2, 2019

Copy link
Copy Markdown
Member

Is it worth adding the code in the previous comment (or something like it) as a test?

mcollina commented Mar 2, 2019

Copy link
Copy Markdown
Member Author

I think so. However it’s not clear if we are doing it in core or not, or it is just user specific (somehow).

Trott commented Mar 2, 2019

Copy link
Copy Markdown
Member

By the way, #26404 is basically the same thing but on the client end rather than the server end.

Comment thread lib/_http_server.js Outdated

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Changing to parser != null would work also and be a bit safer

lpinca commented Mar 3, 2019

Copy link
Copy Markdown
Member

I think we need to understand why this happens or we could mask a bug instead of fixing it. It would be great if @bjjenson or @jasine could provide a test case to reproduce the issue.

mcollina commented Mar 3, 2019

Copy link
Copy Markdown
Member Author

The overall problem with supporting a “delete” case is that it could trigger the vulnerability we are trying to protect against.

socket.parser can be undefined under unknown circumstances.
This is a fix for a bug I cannot reproduce but it is affecting
people.

Fixes: nodejs#26366

mcollina commented Mar 6, 2019

Copy link
Copy Markdown
Member Author

mcollina commented Mar 6, 2019

Copy link
Copy Markdown
Member Author

Landed in 3c83f93

mcollina closed this Mar 6, 2019

mcollina commented Mar 6, 2019

Copy link
Copy Markdown
Member Author

@nodejs/lts this should be backported asap to all lines.

gireeshpunathil pushed a commit to gireeshpunathil/node that referenced this pull request Mar 6, 2019
socket.parser can be undefined under unknown circumstances.
This is a fix for a bug I cannot reproduce but it is affecting
people.

Fixes: nodejs#26366

PR-URL: nodejs#26402
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

Copy link
Copy Markdown
Member

@nodejs/lts this should be backported asap to all lines.

Probably too late for 11.11.0, but ping @BridgeAR.

BridgeAR commented Mar 6, 2019

Copy link
Copy Markdown
Member

@richardlau I would rather pull that into the release afterwards.

lpinca commented Mar 7, 2019
edited
Loading

Copy link
Copy Markdown
Member

I've finally found the root issue behind #26366 or better in https://github.com/eggjs/egg-socket.io.

The problem is that our request.socket is replaced by egg-socket.io with the socket.io Socket. See https://github.com/eggjs/egg-socket.io/blob/9e7f71d835930d3a63c69635488737066f779661/lib/connectionMiddlewareInit.js#L8-L9.

There is nothing wrong with this fix but the problem is in egg-socket.io and may arise again.

I think the regression test added here does not make much sense.

BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Mar 12, 2019
socket.parser can be undefined under unknown circumstances.
This is a fix for a bug I cannot reproduce but it is affecting
people.

Fixes: nodejs#26366

PR-URL: nodejs#26402
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BridgeAR pushed a commit that referenced this pull request Mar 14, 2019
socket.parser can be undefined under unknown circumstances.
This is a fix for a bug I cannot reproduce but it is affecting
people.

Fixes: #26366

PR-URL: #26402
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BethGriggs pushed a commit that referenced this pull request Apr 16, 2019
socket.parser can be undefined under unknown circumstances.
This is a fix for a bug I cannot reproduce but it is affecting
people.

Fixes: #26366

PR-URL: #26402
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BethGriggs mentioned this pull request May 1, 2019
BethGriggs pushed a commit that referenced this pull request Sep 19, 2019
socket.parser can be undefined under unknown circumstances.
This is a fix for a bug I cannot reproduce but it is affecting
people.

Fixes: #26366

PR-URL: #26402
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BethGriggs mentioned this pull request Sep 19, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

http Issues or PRs related to the http subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot set property 'parsingHeadersStart' of undefined on 10.15.2

10 participants


Back | FazBrowse Home | New Git URL