Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cntlm crashed in sparc solaris 11 #93

Open
yfchua opened this issue Jan 11, 2024 · 11 comments
Open

cntlm crashed in sparc solaris 11 #93

yfchua opened this issue Jan 11, 2024 · 11 comments

Comments

@yfchua
Copy link

yfchua commented Jan 11, 2024

when the cntlm is running in threading mode, and accessing the https website.
the cntlm will crash with memory fault.

when the cntlm is running in serial mode, and accessing the https website, it is running ok,

this only happen after there is change of proxy.
this is sparc solaris 11,
i run ./configure, gmake to make binary.

THank you

@fralken
Copy link
Collaborator

fralken commented Jan 12, 2024

Hello @yfchua, can you elaborate better your use case? I guess the issue is "this only happen after there is change of proxy". This can be due to a race condition. Are you using a pac file? What is the sequence of operations that cause the fault?

@yfchua
Copy link
Author

yfchua commented Jan 16, 2024

I run the cntlm. Cntlm connect to my company blue coat proxy.
I set the https_proxy=http://localhost:3128
I run curl https://wew.google.com
Cntlm crashed with Bus error

Sending PROXY auth request…
Host => www.google.com



Reading PROXY auth response…
HEAD: HTTP/1.1 407 Proxy Authentication Required
….


NTLM Challenge:
Challenge: ….
….
….
….

NTLMv2:
Nonce:27CB870A54274EF3
Timestamp: 31082536

Bus error

@yfchua
Copy link
Author

yfchua commented Jan 16, 2024

According to internet , bus error occur when a process is trying to access memory cpu cannot physically access.

This only happens after the proxy was upgraded.
Cntlm is running fine before proxy upgrade

@fralken
Copy link
Collaborator

fralken commented Jan 16, 2024

So the issue happens after an upgrade of the remote proxy, while before this upgrade everything worked fine. It looks like something changed in the NTLM challenge phase. Can you test Cntlm on a windows or mac or linux machine? Just to check if the problem is related to Solaris. This scenario is very difficult to replicate, you could try and debugging it yourself.

@yfchua
Copy link
Author

yfchua commented Jan 16, 2024

Hi
It only happen on the Solaris sparc server. It does not happen on the x86 Linux server. I not a c programmer, so it is hard for me to debug.

@fralken
Copy link
Collaborator

fralken commented Jan 17, 2024

Ok, then it is an issue of Sparc Solaris only. Maybe it is related to the cpu endianness. Is it big endian? What is the output of ./configure?

@yfchua
Copy link
Author

yfchua commented Jan 19, 2024

It is big endian

@fralken
Copy link
Collaborator

fralken commented Jan 19, 2024

Can you try this branch on my repo?

git clone -b nonce-endianness https://github.com/fralken/cntlm.git

I guess the nonce is not correctly passed to the NTLM token in case of big endian.

@yfchua
Copy link
Author

yfchua commented Jan 23, 2024

Hi
Thank for the help I will clone it and test it asap

@yfchua
Copy link
Author

yfchua commented Jan 30, 2024

Unfortunately the fix for the big endian did not work
I captured the core dump and did a backtrack please refer to the screen capture
IMG_3751

@fralken
Copy link
Collaborator

fralken commented Jan 31, 2024

Hello, unfortunately this dump is not helpful, it doesn't show where the program crashed.

Just to understand, you said that cntlm worked until the remote proxy was upgraded. What was the change? which authentication method used the old proxy? The new proxy uses NTLMv2.

This is probably a problem of uint32 alignment.

Also, which compiler are you using? gcc, clang?

Can you try again with this repo?
git clone -b nonce-endianness https://github.com/fralken/cntlm.git

Repository owner deleted a comment from i-am-yuvi Feb 23, 2024
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

No branches or pull requests

2 participants