Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 668 of 808  Not logged in ELOG logo
    icon2.gif   Re: Elogd crashes with: *** stack smashing detected ***, posted by Niklas on Fri Jan 9 10:41:20 2009 

Stefan Ritt wrote:

 

Niklas wrote:

 

Stefan,

perhaps there should be something like the bold text below in elogd.c:

int process_http_request(const char *request, int i_conn)^M
...

   /* extract cookies */^M
   if ((p = strstr(request, "Cookie:")) != NULL) {^M
      p += 6;^M
      do {^M
         p++;^M
         while (*p && *p == ' ')^M
            p++;^M
         strlcpy(str, p, sizeof(str));^M
         for (i = 0; i < (int) strlen(str); i++)^M
            if (str[i] == '=' || str[i] == ';')^M
               break;^M
         if (str[i] == '=') {^M
            str[i] = 0;^M
            p += i + 1;^M
            for (i = 0; *p && *p != ';' && *p != '\r' && *p != '\n' && i < (int) sizeof(cookie); i++)
                      cookie[i] = *p++;

...

 

Wow, where did you get that long cookie from? Certainly not from elogd. You must run elogd under Apache, and have some other service next to it on your server which distributes this long cookies, that's why other people did not experience this problem yet. I appreciate your fix. It's alwasy nice to see users not only complain about things, but try to fix them. Your fix is almost correct, you need a

i<(int) sizeof(cookie)-1

since there is the trailing zero for terminating the cookie string. I applied your fix to SVN revision #2146.

 Just noticed that this fix does not work. Elog cookies e.g. "upwd" may be after other long cookies its not seen, as now it stops reading the cookie-string after 256 chars. There needs to be something that goes through the cookies and saves only elog cookies... Would probably be better if you code that, if you have time  =D

 

BR, niklas

    icon2.gif   Re: Google Chrome issues, posted by John Rouillard on Sat Jan 10 23:43:36 2009 
> Any ideas? I run our ELOG on windows server.. maybe that has something to do with it.

I am running the server on kubuntu 8.x, and have the same issue with chrome 1.x.
Is is possible the corporate elog server is running behind apache or in some
other proxy config while the one you are having issues with is being connected
to directly by chrome?

-- rouilj
    icon2.gif   Re: Google Chrome issues, posted by kyoo on Sun Jan 11 22:48:38 2009 
> > Any ideas? I run our ELOG on windows server.. maybe that has something to do with it.
> 
> I am running the server on kubuntu 8.x, and have the same issue with chrome 1.x.
> Is is possible the corporate elog server is running behind apache or in some
> other proxy config while the one you are having issues with is being connected
> to directly by chrome?
> 
> -- rouilj

So, is your kubuntu elog server internal only, as well?  My elog server on windows is an internal only server.. 
and there is no proxy or firewall between chrome and the elog server.. I didn't set it up, but I think elogd runs 
it's own web service.. probably apache within the win32 port.

It's good to know someone else has the issue, at least.  I'd like to find a publicly available elog server so 
that the elog developers could recreate the issue and thusly fix the issue.  Or at the very least send the broken 
URL to Google Chrome developers to see if it's a bug in the browser or not.

I ran wireshark to capture what happens at the ethernet level, and it seems that the HTTP response doesn't come 
through properly.  My response packets to the TCP response packets seems to be:

"Acknowledgment number: Broken TCP. The acknowledge field is nonzero while the ACK flag is not set"
My system never receives enough TCP packets to reassemble it to a properly formatted HTTP response.


The stream goes like this:
GET /Company+IT+Change+Log/ HTTP/1.1 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/525.19 (KHTML, like Gecko) 
Chrome/1.0.154.42 Safari/525.19 
Referer: http://changelog.Company.com/Company+IT+Change+Log/?cmd=New 
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 
Accept-Encoding: gzip,deflate,bzip2,sdch 
Cookie: unm=Name; upwd=amhpbGoijoihbmQ=; urem=1 
Accept-Language: en-US,en 
Accept-Charset: ISO-8859-1,*,utf-8 
Host: changelog.Company.com 
Connection: Keep-Alive 
 
HTTP/1.1 200 Document follows 
Server: ELOG HTTP 2.7.5-2130 
Content-Type: text/html;charset=ISO-8859-1 
Set-Cookie: elmode=Summary; path=/Company+IT+Change+Log; expires=Tuesday, 09-Jun-20 12:31:45 GMT; 
 path=/Company+IT+Change+Log; 
Connection: Keep-Alive 
Keep-Alive: timeout=60, max=10 
Pragma: no-cache 
Expires: Fri, 01 Jan 1983 00:00:00 GMT 
Content-Length: 24455 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<title>ELOG Company IT Change Log</title>
<link rel="stylesheet" type="text/css" href="default.css">
<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="favicon.png" type="image/png" />
<link rel="alternate" type="application/rss+xml" title="ELOG Company IT Change Log" href="elog.rdf" />
</head>
<body>
<form name="form1" method="GET" action=".">

<table class="frame" cellpadding="0" cellspacing="0"><!-- show_standard_title -->

<tr><td class="tabs">
<span class="sltab"><a href="../Company+IT+Change+Log/" title="Company 
TI">Company&nbsp;IT&nbsp;Change&nbsp;Log</a></span>
</td></tr>

<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="title1">&nbsp;&nbsp;Company TI, Page 1 of 272&nbsp;</td>
<td class="title2">Logged in as "My Name"</td>
<td class="title3"><img border=0 src="elog.png" alt="ELOG logo" title="ELOG logo"></td>
</tr></table></td></tr>

<tr><td class="menuframe"><span class="menu1">
&nbsp;<a href="?cmd=New">New</a>&nbsp;|
&nbsp;<a href="?cmd=Find">Find</a>&nbsp;|
&nbsp;<a href="?select=1">Select</a>&nbsp;|
&nbsp;<a href="?cmd=Import">Import</a>&nbsp;|
&nbsp;<a href="?cmd=Config">Config</a>&nbsp;|
&nbsp;<a href="?cmd=Logout">Logout</a>&nbsp;|
&nbsp;<a href="?cmd=Help">Help</a>&nbsp;
</span></td></tr>

<tr><td class="menuframe">
<table width="100%" border=0 cellpadding="0" cellspacing="0">
<tr>
<td class="menu2a">
&nbsp;<a href="?mode=full">Full</a>&nbsp;|&nbsp;Summary&nbsp;|&nbsp;<a href="?
mode=threaded">Threaded</a>&nbsp;</td>
<td class="menu2b">
<a href="?new_entries=1"><img align="middle" border="0" src="new_entry.png" alt="Show only new entries" 
title="Show only new entries"></a>&nbsp;&nbsp;<select title="Select period" name=last 
onChange="document.form1.submit()">
<option value="_all_">-- All entries --
<option  value=1>Last day
<option  value=7>Last week
<option  value=31>Last month
<option  value=92>Last 3 Months
<option  value=182>Last 6 Months
<option  value=364>Last Year
</select>
<select title="Select Type" name="Type" onChange="document.form1.submit()">
<option value="_all_">-- Type --
<option value="^Hardware$">Hardware
<option value="^Software$">Software
<option value="^Database$">Database
<option value="^Network$">Network
<option value="^NGS Applications$">NGS Applications
<option value="^Storage$">Storage
<option value="^Monitor$">Monitor
<option value="^VMware$">VMware
</select> 
<noscript>
<input type=submit value="Search">
</noscript>
&nbsp;<b>5429 Entries</b>&nbsp;</td></tr></table></td></tr>

<tr><td class="menuframe"><span class="menu3">
Goto page 
1, 
<a href="page2">2</a>, 
<a href="page3">3</a>&nbsp;...&nbsp;<a href="page270">270</a>, 
<a href="page271">271</a>, 
<a href="page272">272</a>&nbsp;&nbsp;
<a href="page2">Next</a>&nbsp;&nbsp;</span></td></tr>
<tr><td><table class="listframe" width="100%" cellspacing=0>
<tr>
<th  class="listtitle"><a href="?sort=ID">ID</a></th>
<th  class="listtitle"><a href="?sort=Date">Date</a></th>
<th  class="listtitle"><a href="?sort=Author">Author</a></th>
<th  class="listtitle"><a href="?sort=Author+Email">Author Email</a></th>
<th  class="listtitle"><a href="?sort=Type">Type</a></th>
<th  class="listtitle"><a href="?sort=Category">Category</a></th>
<th  class="listtitle"><a href="?sort=Subject">Subject</a></th>
<th  class="listtitle"><a href="?sort=Last+Revision">Last Revision</a></th>
<th  class="listtitle"><a href="?sort=Reason+for+Change">Reason for Change</a></th>
<th class="listtitle">Text</th>
<th class="listtitle"><img src="attachment.png" alt="Attachments" title="Attachments"</th></tr>

<tr><td class="list2">
<a href="../Company+IT+Change+Log/5431">&nbsp;&nbsp;5431&nbsp;&nbsp;</a>
</td>

<td class="list2" nowrap><a href="../Company+IT+Change+Log/5431">1/9/2009 4:40:54 PM</a></td>
<td class="list2"><a href="../Company+IT+Change+Log/5431">Gary</a></td><td class="list2"><a 
href="../Company+IT+Change+Log/5431"><a href="gmercier@Company.com">gmercier@Company.com</a></a></td><td 
class="list2"><a href="../Company+IT+Change+Log/5431">Applications</a></td><td class="list2"><a 
href="../Company+IT+Change+Log/5431">Patch - Hotfix</a></td><td class="list2"><a 
href="../Company+IT+Change+Log/5431">PRN 18718 Update</a></td><td class="list2"><a 
href="../Company+IT+Change+Log/5431"></a>&nbsp;</td><td class="list2"><a 
href="../Company+IT+Change+Log/5431"></a>&nbsp;</td><td class="summary">A</td>
<td class="listatt">&nbsp;&nbsp;</td><tr><td class="list1">
<a href="../Company+IT+Change+Log/5430">&nbsp;&nbsp;5430&nbsp;&nbsp;</a>
</td>

<td class="list1" nowrap><a href="../Company+IT+Change+Log/5430">1/9/2009 4:37:01 PM</a></td>
<td class="list1"><a href="../Company+IT+Change+Log/5430">Gary</a></td><td class="list1"><a 
href="../Company+IT+Change+Log/5430"><a href="gary@compan


Then the stream just aborts, apparently.
    icon2.gif   Re: Google Chrome issues, posted by John Rouillard on Mon Jan 12 05:12:42 2009 
> > > Any ideas? I run our ELOG on windows server.. maybe that has something to do with it.
> > 
> > I am running the server on kubuntu 8.x, and have the same issue with chrome 1.x.
> > Is is possible the corporate elog server is running behind apache or in some
> > other proxy config while the one you are having issues with is being connected
> > to directly by chrome?
>
> It's good to know someone else has the issue, at least.  I'd like to find a publicly available elog server so 
> that the elog developers could recreate the issue and thusly fix the issue.  Or at the very least send the broken 
> URL to Google Chrome developers to see if it's a bug in the browser or not.

I just brought up the current head release of elog, and the problem is fixed. Looks like it 
was some sort of cookie issue IIRC the log entry.

So build a new elogd and you should be all set.

- rouilj
    icon2.gif   Re: Google Chrome issues, posted by kyoo on Mon Jan 12 05:33:04 2009 
> > > > Any ideas? I run our ELOG on windows server.. maybe that has something to do with it.
> > > 
> > > I am running the server on kubuntu 8.x, and have the same issue with chrome 1.x.
> > > Is is possible the corporate elog server is running behind apache or in some
> > > other proxy config while the one you are having issues with is being connected
> > > to directly by chrome?
> >
> > It's good to know someone else has the issue, at least.  I'd like to find a publicly available elog server so 
> > that the elog developers could recreate the issue and thusly fix the issue.  Or at the very least send the broken 
> > URL to Google Chrome developers to see if it's a bug in the browser or not.
> 
> I just brought up the current head release of elog, and the problem is fixed. Looks like it 
> was some sort of cookie issue IIRC the log entry.
> 
> So build a new elogd and you should be all set.
> 
> - rouilj

Thanks.  I'll have to wait for someone else to build the win32 binary, as I'm not set up to compile it myself.
    icon2.gif   Re: Google Chrome issues, posted by kyoo on Mon Jan 12 21:00:27 2009 
> > > > > Any ideas? I run our ELOG on windows server.. maybe that has something to do with it.
> > > > 
> > > > I am running the server on kubuntu 8.x, and have the same issue with chrome 1.x.
> > > > Is is possible the corporate elog server is running behind apache or in some
> > > > other proxy config while the one you are having issues with is being connected
> > > > to directly by chrome?
> > >
> > > It's good to know someone else has the issue, at least.  I'd like to find a publicly available elog server so 
> > > that the elog developers could recreate the issue and thusly fix the issue.  Or at the very least send the broken 
> > > URL to Google Chrome developers to see if it's a bug in the browser or not.
> > 
> > I just brought up the current head release of elog, and the problem is fixed. Looks like it 
> > was some sort of cookie issue IIRC the log entry.
> > 
> > So build a new elogd and you should be all set.
> > 
> > - rouilj
> 
> Thanks.  I'll have to wait for someone else to build the win32 binary, as I'm not set up to compile it myself.

I installed the latest Windows build (didn't realize I missed a build in November), and it now works in Chrome.  Thanks!
    icon2.gif   Re: Elogd crashes with: *** stack smashing detected ***, posted by Niklas on Tue Jan 13 14:30:37 2009 

 

Stefan,

To solve the problem I suggest following change to elogd.c (2.7.5 2159).

Create a list of elog cookies, and store only these as parameters. Example diff:

---
$ diff elog/src/elogd.c elogd_niho.c
26557a26558
>    const char *cookie_list[] = { "upwd", "unm", "elmode", "urem", "wpwd", "apwd", "uname", NULL };
26603c26604,26610
<          setparam(str, cookie);
---
>          for(i=0; cookie_list[i]; i++) {
>             if(strcmp(cookie_list[i], str) == 0) {
>                setparam(str, cookie);
>                break;
>             }
>          }
>
---

In a more readable fashion:
int process_http_request(const char *request, int i_conn)
{
...
const char *cookie_list[] = { "upwd", "unm", "elmode", "urem", "wpwd", "apwd", "uname", NULL };
...
...
...
         /* store cookie as parameter */
         for(i=0; cookie_list[i]; i++) {
            if(strcmp(cookie_list[i], str) == 0) {
               setparam(str, cookie);
               break;
            }
         }

...

 

Not sure if I got all the cookies used by elog.

 

BR, niklas

icon1.gif   Top group causes: Internal error, no valid header!, posted by Michael Ambrus on Tue Jan 20 15:09:54 2009 

Having "Top group" in a config-file for Windows will cause:

 

GET / HTTP/1.1
Host: eudr6j03j:8084
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.9.0.5) Gecko/20
08120122 Firefox/3.0.5
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: sv-se,sv;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: unm=mambrus; upwd=U2lzc2kx; urem=0
Cache-Control: max-age=0


Internal error, no valid header!

 

Removing "top group" makes elogd.exe work. The error is repeatable and the same config file works on the same version of Elog on Linux. Elog was compiled with Cygwin.

ELOG V3.1.5-3fb85fa6