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

Special characters in PKI object names causing errors #190

Closed
leechristensen opened this issue Jun 22, 2023 · 4 comments
Closed

Special characters in PKI object names causing errors #190

leechristensen opened this issue Jun 22, 2023 · 4 comments
Labels
bug Bug. An issue exist in our code.
Milestone

Comments

@leechristensen
Copy link

PSPKI appears to have a bug if templates or CAs contain LDAP-related special characters. I assume this is caused when a template/CA name containing special chars is used when constructing an LDAP DN. The solution is to escape these special characters, as outlined here.

Reproduction steps:

  1. Run Get-CertificationAuthority | Get-CATemplate and note that it runs successfully.
  2. Duplicate the default User template and name it asdf/asdf
  3. Run Get-CertificationAuthority | Get-CATemplate and note that it fails.

I have not tested if special chars in the CA's name causes issues, but I suspect it does.

Related issues in PSPKIAudit:

GhostPack/PSPKIAudit#19 - Forward slash in template name causing issue
GhostPack/PSPKIAudit#13 - Template common name lookup likely failing due to special char in CN
GhostPack/PSPKIAudit#9 - Unescaped special char in CA's name potentially causing issue in LDAP DN

@Crypt32 Crypt32 added the bug Bug. An issue exist in our code. label Jun 22, 2023
@Crypt32 Crypt32 added this to the v4.1 milestone Sep 18, 2023
Crypt32 added a commit to PKISolutions/pkix.net that referenced this issue Sep 19, 2023
@Crypt32
Copy link
Collaborator

Crypt32 commented Sep 19, 2023

I was able to figure out how to solve this particular issue. It did pass my own tests, though I'd like to get a confirmation that the fix is compatible with your module. I believe that this fix addresses all issues you referenced here. Attaching debug builds for your testing:

SysadminsLV.PKI.Win-v4.0.3.zip. Extract files into PSPKI's Library folder.

Note: this fix works only with PSPKI v4.0. The fix doesn't apply to PSPKI v3.7.2.

@leechristensen
Copy link
Author

I can confirm these changes work. However, the latest version in the PSGallery does not seem to have this support.

@Crypt32
Copy link
Collaborator

Crypt32 commented Dec 14, 2023

I can confirm these changes work. However, the latest version in the PSGallery does not seem to have this support.

yep, the work is in progress. The code is almost ready to ship, however there is a lot of work on docs which is planned next week. I hope to get new release by Christmas.

@Crypt32
Copy link
Collaborator

Crypt32 commented Jan 18, 2024

fixed in v4.2

@Crypt32 Crypt32 closed this as completed Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug. An issue exist in our code.
Projects
None yet
Development

No branches or pull requests

2 participants