New issue
Advanced search Search tips

Issue 804262 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Segfault within CSP reporting in headless chrome

Reported by d...@hellofutu.re, Jan 22 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36

Steps to reproduce the problem:
Setup Chrome headless running inside a docker container using this container https://hub.docker.com/r/alpeware/chrome-headless-trunk/

1. Setup a Content security policy to report errors

2. Go to a web page that triggers that content security policy violation. 

3. Watch as the CSP violation report triggers a segfault.

What is the expected behavior?
No segfault. The CSP report should be sent to the server with no problem.

What went wrong?
A segfault occurs. 

chrome_1             | [0122/100704.056478:INFO:CONSOLE(0)] "Refused to load the script 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js' because it violates the following Content Security Policy directive: "script-src 'self' 'nonce-4bc978cf12db026c8f2edfb2'".
chrome_1             | ", source: http://redacted.example.com/csp/test (0)
varnish_1            | 172.18.0.1 - - [22/Jan/2018:10:07:03 +0000] "GET http://redacted.example.local/csp/test HTTP/1.1" 200 200 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/66.0.3329.0 Safari/537.36"
chrome_1             | Received signal 11 SEGV_MAPERR 000000000000
chrome_1             | #0 0x5558559d170c base::debug::StackTrace::StackTrace()
chrome_1             | #1 0x5558559d1271 base::debug::(anonymous namespace)::StackDumpSignalHandler()
chrome_1             | #2 0x7f308d753330 <unknown>
chrome_1             | #3 0x555854994fc7 content::RenderProcessHostImpl::Cleanup()
chrome_1             | #4 0x55585480b264 content::KeepAliveHandleFactory::Context::~Context()
chrome_1             | #5 0x55585480b36b content::KeepAliveHandleFactory::KeepAliveHandleImpl::~KeepAliveHandleImpl()
chrome_1             | #6 0x55585480b0e7 mojo::BindingSetBase<>::OnConnectionError()
chrome_1             | #7 0x5558561105a2 mojo::InterfaceEndpointClient::NotifyError()
chrome_1             | #8 0x555856117772 mojo::internal::MultiplexRouter::ProcessNotifyErrorTask()
web_server_1         | 172.18.0.9 - - [22/Jan/2018:10:07:04 +0000] "POST /csp HTTP/1.1" 204 0 "http://redacted.example.local/csp/test" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/66.0.3329.0 Safari/537.36"
chrome_1             | #9 0x555856115c4f mojo::internal::MultiplexRouter::ProcessTasks()
chrome_1             | #10 0x555856114a6f mojo::internal::MultiplexRouter::OnPipeConnectionError()
chrome_1             | #11 0x55585610eaa4 mojo::Connector::HandleError()
chrome_1             | #12 0x55585612094a mojo::SimpleWatcher::OnHandleReady()
chrome_1             | #13 0x5558559d30bf base::debug::TaskAnnotator::RunTask()
chrome_1             | #14 0x5558559ec887 base::MessageLoop::RunTask()
chrome_1             | #15 0x5558559ecd88 base::MessageLoop::DoWork()
chrome_1             | #16 0x5558559ef36f base::(anonymous namespace)::WorkSourceDispatch()
chrome_1             | #17 0x7f308b688e04 g_main_context_dispatch
chrome_1             | #18 0x7f308b689048 <unknown>
chrome_1             | #19 0x7f308b6890ec g_main_context_iteration
chrome_1             | #20 0x5558559ef232 base::MessagePumpGlib::Run()
chrome_1             | #21 0x555855a0ec15 base::RunLoop::Run()
chrome_1             | #22 0x55585471b591 content::BrowserMainLoop::MainMessageLoopRun()
chrome_1             | #23 0x55585471b393 content::BrowserMainLoop::RunMainMessageLoopParts()
chrome_1             | #24 0x55585471e2c2 content::BrowserMainRunnerImpl::Run()
chrome_1             | #25 0x555859908f2f headless::HeadlessContentMainDelegate::RunProcess()
chrome_1             | #26 0x55585570d870 content::RunNamedProcessTypeMain()
chrome_1             | #27 0x55585570e1c6 content::ContentMainRunnerImpl::Run()
chrome_1             | #28 0x55585571743f service_manager::Main()
chrome_1             | #29 0x55585570cd81 content::ContentMain()
chrome_1             | #30 0x555859908029 headless::(anonymous namespace)::RunContentMain()
chrome_1             | #31 0x55585990809e headless::HeadlessBrowserMain()
chrome_1             | #32 0x555855714250 headless::HeadlessShellMain()
chrome_1             | #33 0x555853fcb1c4 ChromeMain
chrome_1             | #34 0x7f3087ac9f45 __libc_start_main
chrome_1             | #35 0x555853fcb02a _start
chrome_1             |   r8: 0000000000000000  r9: 00000f8e7c6d5750 r10: 00000f8e7c719890 r11: 0000000000000246
chrome_1             |  r12: 00000f8e7ce0b5e8 r13: 00000f8e7cd7b248 r14: 00000f8e7c6d2000 r15: 0000000000000000
chrome_1             |   di: 00000f8e7cd7b248  si: 0000000000000000  bp: 00007ffd743396b0  bx: 00000f8e7ce0b580
chrome_1             |   dx: 00000f8e7cd7b248  ax: 0000000000000000  cx: 0000000000000000  sp: 00007ffd74339630
chrome_1             |   ip: 0000555854994fc7 efl: 0000000000010246 cgf: 002b000000000033 erf: 0000000000000004
chrome_1             |  trp: 000000000000000e msk: 0000000000000000 cr2: 0000000000000000
chrome_1             | [end of stack trace]
chrome_1             | Calling _exit(1). Core file will not be generated.

Crashed report ID: 

How much crashed? Whole browser

Is it a problem with a plugin? N/A 

Did this work before? N/A 

Chrome version: 63.0.3239.0  Channel: n/a
OS Version: OS X 10.13.2
Flash Version: 

This is the test page that has the CSP violation on it:

======
<html>
<body>
  Hello, I am a test page, that tries to load some naughty javascript, which should trigger a CSP report.
</body>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</html>
=====

This is the CSP header that is served with the page:
=====
Content-Security-Policy:default-src 'self'; script-src 'self' 'nonce-40f84db8c21a2dd42a1c7ce7'; style-src 'self' 'unsafe-inline'; report-uri /csp
=====
 

Comment 1 by d...@hellofutu.re, Jan 22 2018

Just to be clear, this is the version reported from inside the container running Chrome headless:

root@495092810a53:/bin# /usr/bin/google-chrome-unstable --version
Chromium 66.0.3329.0

Comment 2 by rsesek@chromium.org, Jan 22 2018

Components: Internals>Headless
Labels: -OS-Mac OS-Linux
Status: Available (was: Unconfirmed)

Sign in to add a comment