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

Missing Server Configuration variable for CAS allowed proxies & Char Buffer for Principal ID too small #32

Closed
fbuehrmann opened this issue Feb 28, 2020 · 2 comments

Comments

@fbuehrmann
Copy link

fbuehrmann commented Feb 28, 2020

Dear developer team,

I am currently using and testing NetXMS with CAS authentication and while setting it up, I came across the following two issues, both of which are related to the file src/server/core/cas_validator.cpp.

The first one is related to the Character buffer char netid[14] in line 161, which is used as target buffer when extracting the username from the <cas:user> XML field of the service ticket validation response. With an array length of 14, it allows for an effective username length of 13 characters. As my CAS server uses the e-mail address as the principal ID/username, this length is insufficient.
Is there a specific reason, why the array length has been set to 14 or could it be increased?

The second issue is related to the validation of CAS Proxy Tickets and the string array char *m_proxies[] in line 56. During proxy ticket validation, it is checked, whether the value of the XML field cas:proxy or cas:proxies is present in the *m_proxies array. This corresponds to line 258 in cas_validator.cpp. However, the value of the array is initialized with { NULL } and I did not find any location in the code, where additional values are added to it, causing the proxy ticket validation to always fail and return the error CAS: bad proxy (...). To solve this issue you could introduce a new server configuration parameter (e.g. CASAllowedProxies) to be used in the method void CASReadSettings (line 62), which then extracts a string array of URLs that are to be used as allowed proxies.

Hopefully, this can help you get rid of these problems.

Kind regards,
fbuehrmann

(Using NetXMS version 3.0-2357, sourcecode was checked both in stable-3.1 as well as master branch)

@2128506
Copy link
Collaborator

2128506 commented Feb 28, 2020

Fixed by commit a19a074

@2128506 2128506 closed this as completed Feb 28, 2020
@fbuehrmann
Copy link
Author

Cool, thank you for the quick commit 👍

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