[JIRA] (JENKINS-36805) Response buffer overflow when logging in as user w/o Jenkins permissions set

17 views
Skip to first unread message

acwwat@gmail.com (JIRA)

unread,
Jul 19, 2016, 5:21:01 PM7/19/16
to jenkinsc...@googlegroups.com
Anthony Wat created an issue
 
Jenkins / Bug JENKINS-36805
Response buffer overflow when logging in as user w/o Jenkins permissions set
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: exception.txt
Components: security
Created: 2016/Jul/19 9:20 PM
Environment: RHEL7 64-bit, JDK 1.8.0_92, Jenkins 2.14, RPM installation, Chrome latest
Priority: Minor Minor
Reporter: Anthony Wat

I have recently set up a new Jenkins instance with active directory for access control (Active Directory plugin 1.47 used). For testing authentication, I have added my AD user with overall administer permission and left Anonymous without any permission - that is there are only two entries in the project-based authorization matrix.

WIth this configuration, I can log in just fine. Then I asked another AD user to log in, and what they get is an error 500 with the attached exception regarding response header overflow. I've attempted to increase the response header size by setting the jetty.httpConfig.responseHeaderSize system property to 32768 (4 x default 8K) but user still gets error 500 with the same exception. I've not done any debugging so I do not know what value is causing the buffer overflow.

I then realize that there is effectively no permission set for the authenticated user, so I added the authenticated group w/ the overall read permission. After that, the other users were able to log in correctly.

Instead of a buffer overflow, I would think that Jenkins should assume no permission assigned to the authenticated user and thus return a 403 error denying permission. As such I believe that this is a bug that should be addressed. IMO this might not be an issue with the AD plugin but rather with general Jenkins security.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

bfink@qti.qualcomm.com (JIRA)

unread,
Jul 25, 2016, 2:15:01 PM7/25/16
to jenkinsc...@googlegroups.com
Brian Fink commented on Bug JENKINS-36805
 
Re: Response buffer overflow when logging in as user w/o Jenkins permissions set

I am having this issue as well (exactly), however I am not using the AD plugin, I am using LDAP. So I would agree that it is a fundamental problem with security. Adding the user to a group indeed fixed the problem for me, the errors in the Jenkins.log file do not give any clues to what is actually going on.

Jul 25, 2016 5:25:04 PM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Commit failed
java.io.IOException: Response header too large
at org.eclipse.jetty.http.HttpGenerator.generateResponse(HttpGenerator.java:402)
at org.eclipse.jetty.server.HttpConnection$SendCallback.process(HttpConnection.java:655)
at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:246)
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:208)
at org.eclipse.jetty.server.HttpConnection.send(HttpConnection.java:471)
at org.eclipse.jetty.server.HttpChannel.sendResponse(HttpChannel.java:763)
at org.eclipse.jetty.server.HttpChannel.write(HttpChannel.java:801)
at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:147)
at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:140)
at org.eclipse.jetty.server.HttpOutput.close(HttpOutput.java:171)
at com.jcraft.jzlib.DeflaterOutputStream.close(DeflaterOutputStream.java:122)
at org.kohsuke.stapler.compression.FilterServletOutputStream.close(FilterServletOutputStream.java:36)
at java.io.FilterOutputStream.close(FilterOutputStream.java:159)
at sun.nio.cs.StreamEncoder.implClose(StreamEncoder.java:320)
at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:149)
at java.io.OutputStreamWriter.close(OutputStreamWriter.java:233)
at java.io.BufferedWriter.close(BufferedWriter.java:266)
at org.dom4j.io.XMLWriter.close(XMLWriter.java:286)
at org.kohsuke.stapler.jelly.HTMLWriterOutput.close(HTMLWriterOutput.java:70)
at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:56)
at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:95)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
at hudson.security.AccessDeniedHandlerImpl.handle(AccessDeniedHandlerImpl.java:56)
at jenkins.security.ExceptionTranslationFilter.handleException(ExceptionTranslationFilter.java:172)
at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:125)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:499)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.nio.BufferOverflowException
at java.nio.Buffer.nextPutIndex(Buffer.java:521)
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:169)
at org.eclipse.jetty.http.HttpGenerator.putSanitisedName(HttpGenerator.java:1052)
at org.eclipse.jetty.http.HttpGenerator.putTo(HttpGenerator.java:1086)
at org.eclipse.jetty.http.HttpGenerator.generateHeaders(HttpGenerator.java:705)
at org.eclipse.jetty.http.HttpGenerator.generateResponse(HttpGenerator.java:387)
... 65 more

jnord@cloudbees.com (JIRA)

unread,
Feb 16, 2017, 9:34:04 AM2/16/17
to jenkinsc...@googlegroups.com
James Nord closed an issue as Duplicate
 
Change By: James Nord
Status: Open Closed
Resolution: Duplicate

sqa.valentinmarin@gmail.com (JIRA)

unread,
Feb 20, 2017, 10:24:04 AM2/20/17
to jenkinsc...@googlegroups.com

sqa.valentinmarin@gmail.com (JIRA)

unread,
Feb 20, 2017, 10:25:01 AM2/20/17
to jenkinsc...@googlegroups.com
Valentin Marin assigned an issue to Unassigned
Reply all
Reply to author
Forward
0 new messages