Password quoting problem

I'm the phpwiki developer.
Our company uses a Sun LDAP DS, and so far > 1000 users can successfully login in my php-4 app.
But from time to time I get login failures reported, which seem to be related to quoting of some special characters.
I've read in some LDAP protocol description that certain characters may not be transported verbatim and must be quoted, such as:
// LDAP allows all chars but *, (, ), \, NUL
// Quoting is done by \xx (two-digit hexcode). * <=> \2a
// Handling '?' is unspecified
$password = strtr($submitted_password,
                    array("*" => "\\2a",
                         "?" => "\\3f",
                         "(" => "\\28",
                         ")" => "\\29",
                         "\\" => "\\5c",
                         "\0" => "\\00"));
However this quoting will fail for some of my users with * in their password.
2 Questions:
Does the php layer in ldap_bind() already quote that for me?
Does the Sun DS not understand those \xx chars and should I use the verbatim chars instead?

Hi,
There are several places in the LDAP standards where special characters need to be escaped, and they are not all escaped identically...
The first thing is that non ascii characters should be represented in UTF-8.
This is valid for all attribute values.
When LDAP entries are represented in LDIF (text format) the non-ascii and special characters makes the whole value to be base64 encoded.
Distinguished Names (see RFC 4514) do escape specific characters ('"', '+', ',', ';', '<', '>', or '\' among others) with a \.
LDAPv3 search filters do need to be escaped as well in their TEXTUAL forms.
(cn=\2a) means searching for cn values that are strings containing the single start '*' character.
So the code you are displaying here is for Filter escaping.
Passwords are treated by Directory Server as an octet string (per LDAPv3 specification).
However, because the Directory Server cannot know which character set is used on the user terminal that is typing the password, RFC 4511 (section 4.2) specify that clients should transcode textual password to UTF-8.
<quote>
Textual passwords (consisting of a character sequence with a known
character set and encoding) transferred to the server using the
simple AuthenticationChoice SHALL be transferred as UTF-8 [RFC3629]
encoded [Unicode]. Prior to transfer, clients SHOULD prepare text
passwords as "query" strings by applying the SASLprep [RFC4013]
profile of the stringprep [RFC3454] algorithm. Passwords
consisting of other data (such as random octets) MUST NOT be
altered. The determination of whether a password is textual is a
local client matter.
</quote>
This must be consistent for ALL applications, otherwise some will still fail to authenticate the users.
Alternately, you can restrict the passwords to ascii characters (7 bits) for all users.
Regards,
Ludovic.

Similar Messages

  • Please can anyone help with the continuing password rejection problem with email.Ipad and other systems work fine but despite reloading my password on imac it bounces back.Apple store has been visited and I have tried everything they suggest.

    Please can anyone help with the continuing password rejection problem with email on my imac.My Ipad and other systems work fine but despite reloading my password on imac it bounces back.Apple store has been visited and I have tried everything they suggest.

    I use free Yahoo mail webMail access because folders I created in webmail access doesn't get set up in Apple Mail. While I was searching for post about password and keychain issues, I stumbled on several threads that complain about Mail folder issues, so I'm holding off on Apple Mail.
    On the password and keychain issue that your post is all about.  I've been using login keychain to save and automatical fill my login screens for a year or so successfully, with Safari and Chrome. Automatic form fill also works for Facebook login. Unfortunately, about 4 to 6 months ago, automatic password form fill stopped working with Yahoo webmail, while still worked for GMail (Safari and Chrome). I tried deleting the password entry for my two Yahoo email accounts to start fresh, but neither Safari not Chrome will even ask me if I want to save the password. I was so frustrated that I eventually installed the keypassX 0.43 (password manager) that is quite primitive sompare to OS X's keychain (when it works). Probably no surprise to you yet.
    The surprise, to me at least, is that, for whatever reason, password auto form-fill from keychain started working again for Yahoo webmail login on Safari about 5-7 days ago. Still doesn't work on Chrome!
    Two tips I can share, at least with webmail access:
    1. Password is save only for one of my yahoo mail accounts. When I login in with my other yahoo account, I get no prompt to save the password, and form fill doesn't work when I try to log in a second time with my other Yahoo mail account.
    2. On inspection of my login keychain, I see a webform password item saved for my Yahoo account that works with keychain. The name of the password is: login.yahoo.com(MyAccountName1#). When I open the password item and look in the Access Control tab, I see Safari and Chome are listed as allowed to access this password item..
         I also an "Internet password" item with a name of just login.yahoo.com. When I open the the password item, it looks just like the password item created for MyAccountName#1, but the MyAccountName#2 is listed in the Account field. Inside the Access Control tab, no apps are listed in access permission. I added Safari and Chrome to the lists of allowed app, saved the password item.
    Now when I bring up the Yahoo login page(by bookmark) on Safari, form fill fills in MyAccountname#1 for name and the proper password and I can login in. When I change the name to MyAccountName#2, the correct password is retrieved and I can log in! Alas, it still doesn't work on Chrome.
    BTW, I changed the password item type from "Internet password" to "Web Form password" and saw no difference! I also edited the name to be "login.yahoo.com (MyAccountName#2)" to look like the web form password item that works, but it has no effect either.
    From my experimentation, here's my observation:
    1. A Web Form password item is created for the first account name(MyAccountName#1) for login.yahoo.com and typed as Web Form password. When I log in using MyAccountName#2, an Internet Password is created, but no applications are listed as allowed to access the password item, even when the password item was created after just logged in and logged out to yahoo with the account name and password for MyAccountName#2.
    2. Manually adding Safari as an app that is allowed to use the password item works. Doesn't work with Chrome!
    The version of Safari I'm using is Version 5.1.7 (6534.57.2). My installed version of Chrome is Version 21.0.1180.79 beta.

  • Mail outgoing password security problem

    IMac, 10.9.5, Outgoing mail will not work, password security problem, with all mail accounts.

    password security problem,
    Can you provide more details on this?
    Troubleshooting sending and receiving email messages
    Troubleshooting sending email messages

  • PL/SQL: quoting problems (double quotes within PL/SQL, howto?)

    Hello,
    I have a big problem with that: I just cannot use execute immediate to do what I want.
    The goal is that another user than sysdba needs to be able to open/close the wallet (we are sysdba and our client doesn't want us to be able to open the wallet, and we don't want the client to have sysdba), so I take advantage of the fact that procedures are executed by default with the privileges of the user which writes it. So, I try and create a PL/SQL procedure as sys and grant execute rights to the client user.
    To open/close a wallet, the command is:
    alter system set encryption wallet open/close identified by "thepasshere";
    Note the double quotes... They are the problem here (passwords are mixed case and contain special characters). Right now, the only solution I came up with is:
    create or replace procedure open_wallet (passwd in varchar2) is
    begin
    execute immediate 'alter system set encryption wallet open identified by "' || passwd || '";';
    end;
    But that's vulnerable to code injection... So, instead, I tried:
    create or replace procedure open_wallet (passwd in varchar2) is
    cmd varchar2(512);
    begin
    cmd != 'alter system set encryption wallet open identified by ":1"';
    execute immediate cmd using passwd;
    end;
    which yields "ORA-00911: invalid character" - uh?
    Now, if I try:
    create or replace procedure open_wallet (passwd in varchar2) is
    cmd varchar(512);
    begin
    cmd := 'alter system set encryption wallet open identified by :1;';
    execute immediate cmd using passwd;
    end;
    it answers "ORA-28357: password required to open the wallet"
    Aaargh! I see no way around that :(
    Is there a solution at all?

    Did you try including the double quotes in the password bind value? Either when you pass the value in or by adding it in the routine.
    create or replace procedure open_wallet (passwd in varchar2) is
    cmd varchar(512);
    pass varchar(512);
    begin
    cmd := 'alter system set encryption wallet open identified by :1;';
    pass := '"' || passwd || '"';
    execute immediate cmd using pass;
    end;

  • Cyradm and cyrus-quota problems

    I've been getting a cyrus-quota crash every night for a while. Here's part of the crash report:
    +Process: cyrus-quota [28870]+
    +Path: /usr/bin/cyrus/bin/cyrus-quota+
    +Identifier: cyrus-quota+
    +Version: ??? (???)+
    +Code Type: X86 (Native)+
    +Parent Process: launchd [1]+
    +Date/Time: 2008-07-10 22:42:24.139 -0500+
    +OS Version: Mac OS X Server 10.5.4 (9E17)+
    +Report Version: 6+
    +Exception Type: EXC_ARITHMETIC (SIGFPE)+
    +Exception Codes: EXCI386DIV (divide by zero)+
    +Crashed Thread: 0+
    +Thread 0 Crashed:+
    +0 cyrus-quota 0x000032c8 doquotacheck 319+
    +1 cyrus-quota 0x000037cd main 714+
    +2 cyrus-quota 0x00001ee6 start 54+
    I'm thinking it's a problem with one of the cyrus mailboxes being corrupted. I've tried stopping the Mail services and issuing:
    *sudo -u cyrusimap /usr/bin/cyrus/bin/cyrus-quota -f*
    *sudo -u cyrusimap /usr/bin/cyrus/bin/ctl_cyrusdb -r*
    *sudo /usr/bin/cyrus/bin/reconstruct*
    But the crashes persist. I wanted to go in with cyradm and weed out unnecessary mailboxes to see if that helps, but I'm unable to login with the cyradm tool:
    *cd /usr/bin/cyrus/admin/*
    *./cyradm -user cyrusimap localhost*
    Password:
    *cyradm: cannot authenticate to server with as cyrusimap*
    I've tried setting the password for the cyrusimap user, using *passwd cyrusimap*, thinking it might be an authentication problem, but I still can't login. I read usually cyrus uses sasl to check passwords, but there's no mention of saslpwcheckmethod in /etc/imapd.conf. Does OS X handle passwords differently?
    Any help on using cyradm or with cyrus-quota crashes?

    Ok, I seemed to have resolved this in my case.
    The crash appears (for me atleast) to have been caused by mailboxes in the mail store that did NOT have a quota set.
    If you execute 'sudo -u _cyrus /usr/bin/cyrus/bin/cyrus-quota it will list quotas on all mailboxes. Look down the list of users which should be something like this: -
    Quota %Used Used Root
    10240 65 6726 user/fred
    10240 0 0 user/bert
    0 15684 user/ernie
    In the example above, ernie has no quota set. This seems to cause the 'cyrus-quota -q' crash (maybe a bug where a 'null' value is causing cyrus-quota to bomb-out?).
    I resolved it by setting a quota for EVERY user, reconstructing the cyrus db and then fixing quotas via the following steps (please note this is for 10.5 Server only and will not work on earlier versions). Make sure you have a backup of everything first.
    1 - Open WGM and ensure ALL users have a quota (I set a high number for those who dont actually need to be quota'd eg. 2gb) Apply changes and quit.
    2 - Stop Mail service in server admin
    open a Terminal and issue the following commands:
    3 - sudo mv /var/imap /var/imap.old
    4 - sudo mkdir /var/imap
    5 - sudo /usr/bin/cyrus/tools/mkimap
    6 - sudo chown -R _cyrus:mail /var/imap
    7 - sudo /usr/bin/cyrus/bin/reconstruct -i
    8 - sudo -u _cyrus /usr/bin/cyrus/bin/cyrus-quota -f
    9 - check all accounts listed have THREE numbers beside them, Quota, Used% and Used.
    10 - test it with sudo -u _cyrus /usr/bin/cyrus/bin/cyrus-quota -q (if all is well it will just return a prompt with no error messages).
    11 - Start the mail service back up in Server Admin and test thoroughly.
    N.B. For me, I HAD to rebuild the database first (Steps 3 - 7), you MAY be able to skip these steps which would preserve the seen-state of your users email.
    Good luck.

  • AD Password Change Problem

    Hi,
    We are using a number of Intel based OSX 10.4 machines bound to a Windows 2003 Forest / Domain.
    We have run into a problem where users are unable to change there AD passwords using the Access applet from within System Prefs, it gives an error about a possible policy problem. I have tried doing the same thing using the Kerberos utility which gives similar results. If we set a user account to force the password to be changed the next login it works which is puzzling. Password changes are working without problem from within our Windows environment.
    I was wondering if anyone can shed any light on the matter?
    Many Thanks
    Tim

    Refer to the post titled "JNDI, Active Directory & Changing Passwords" at JNDI, Active Directory & Changing Passwords

  • XML invalid character -  a single quote problem

    Hi, I am reading in an xml file, then write the file to output. The problem is that the input file has a strange single quote character [ *�*  ] - lets call it single quoate A, which is different from [  *'*  ] , that is the key next to the [ ; ] key on an English keyboard - lets call it single quate B. And in fact there isnt a key to input single quote A, I guess the appearance of single quote A is due to encoding.
    If I open the input xml file in browser, it works ok and displays the single quote A.
    Once I read in the xml file into memory, by debugging I can still see that single quote A is corrected encoded;
    However once I rewrite the same content to output, the single quote A character is changed, and if i open the file in browser, it says 'invalid character' because single quote A were changed when written to output and cannot be rendered.
    Both input and output xml are using UTF-8 encoding. How can I solve this problem please?
    The xml file looks:
    <?xml version="1.0" encoding="UTF-8" ?>
    <content>....1980�s (Peacock and Williams, 1986; Keay, 1984)</content> My code for reading
    String _xquery ="//content/text()";
    Document _xmlDoc= DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("myxml.xml");
    XPath _xpath = XPathFactory.newInstance().newXPath();
    NodeList nodes = (NodeList) _xpath.compile(query).evaluate(_xmlDoc, XPathConstants.NODESET);
    List<String> res = new ArrayList<String>(nodes.getLength());
    for (int i = 0; i < nodes.getLength(); i++) {
        res.add(nodes.item(i).getNodeValue());
    String valueToOuput=res.toString() //this is the value to be output to xml, it shoud look like "[....1980�s (Peacock and Williams, 1986; Keay, 1984)]"my code for writing xml
    Element root=new Element("root");;
    Element content= new Element("output-content")
    content.setText(valueToOutput);
    root.addContent(content);
    PrintWriter writer = new PrintWriter(new FileWriter(f));
    new XMLOutputter().output(domDocument, writer);
    writer.close();

    Hi, sorry I have fixed the problem... instead of using PrintWriter, I used Fileoutputstream, and it solved the problem. Thanks!

  • Mssql single quote problem!

    Hi,
    I user servlet to update MS SQL2000. My problem is there is a single quote inside a text string!
    I can't use double quote for string, as it is not a valid statement for MSSQL. I need to use single quote, but there is single quote inside the string, how can I handle the string?
    String mstrnig="I'm a boy";
    String mSQL = "UPDATE news SET " + "title='" + mstring + "' WHERE code =" + mcode;
    Thanks

    the cleanest and easiest soln is to use preparedStatement.
    PreparedStatement ps = con.prepareStatement("update table comment=? where id = ?");
    ps.setString(1,"That's way to do it");
    ps.setInt(1,8);//some itn value
    ps.execute();

  • I've just setup my new iPad Air. With new Apple ID ect everything working fine, but I can't redeem my iTunes voucher it says wrong password/ user name but they are not wrong. I've reset password same problem anyone help?

    II've just setup a new iPad Air for my daughter with a new apple ect, everything is working fine, but I can't get it to redeem the I tunes voucher. It asks for I'd and password, put them in and comes up with wrong Id/password. They are not incorrect answers, but reset password just incase. Same problem. Also tried making another apple account. Same problem again can anyone help?? Please  

    Your iTunes Voucher is link to the old Apple ID.

  • Is this a CONCAT problem re: David Powers, or a Magic Quotes problem...

    I've tried to figure this out with the posts (and some info
    on David's site, etc), and I just can't seem to figure out the real
    problem.
    I'm working on a tutorial and I can't figure out if the error
    message is correct and it's improper coding inserted by DW (and if
    so, I can't figure out what to correct) or
    If this is a problem with DW8.0.2 along the lines of what the
    hotfix that seems to be so hard to get will fix, or
    If this is along the lines of an example of why magic quotes
    should be turned off, and if so, where/how do I turn them off, and
    will that correct the code, and if not, how would it be properly
    corrected?
    Here is the error message:
    Parse Error: parse error, unexpected '=', expecting ',' or
    ')' in <thefile> on line 34.
    Here is the code it is referencing:
    32 $Search_rsSearch = "abc";
    33 if (isset(#txtSearch#)) {
    34 $Search_rsSearch = (get_magic_quotes_gpc()) ? #txtSearch#
    : addslashes(#txtSearch#);
    35 }
    36 mysql_select_db($database_dorknozzle, $dorknozzle);
    37 $query_rsSearch = sprintf("SELECT * FROM EmployeeStore
    WHERE ItemName LIKE CONCAT('%%', %s,
    '%%')", GetSQLValueString($Search_rsSearch, "text"));
    38 $rsSearch = mysql_query($query_rsSearch, $dorknozzle) or
    die(mysql_error());
    39 $row_rsSearch = mysql_fetch_assoc($rsSearch);
    40 $totalRows_rsSearch = mysql_num_rows($rsSearch);
    I'm using php4.4.4, mysql5.0.24, apache2.2.3
    Thank You,
    Jeff G.

    xViPERed wrote:
    > If this is a problem with DW8.0.2 along the lines of
    what the hotfix that
    > seems to be so hard to get will fix,
    That will fix part of your problem, but the error is caused
    by something
    else:
    > Here is the error message:
    >
    Parse Error: parse error, unexpected '=', expecting ',' or
    ')' in
    > <thefile> on line 34.
    >
    > Here is the code it is referencing:
    > 32 $Search_rsSearch = "abc";
    > 33 if (isset(#txtSearch#)) {
    > 34 $Search_rsSearch = (get_magic_quotes_gpc()) ?
    #txtSearch# :
    > addslashes(#txtSearch#);
    > 35 }
    # is one of the PHP characters used to comment out part of a
    script. I
    suspect that you have got this from the Dreamweaver help
    files, which
    are particularly unhelpful on this point. The show the
    runtime value
    expression as #formFieldName#, which is ColdFusion style, not
    PHP. You
    need to replace #txtSearch# with something like
    $_GET['search'] or
    $_POST['search'].
    What makes things worse is that the code inserted by 8.0.2
    without the
    hotfix is also incorrect. Line 34 should be something like
    this:
    $Search_rsSearch = $_GET['search'];
    Line 37 is also wrong.
    > 37 $query_rsSearch = sprintf("SELECT * FROM
    EmployeeStore WHERE ItemName LIKE
    > CONCAT('%%', %s,
    > '%%')", GetSQLValueString($Search_rsSearch, "text"));
    It should be this:
    $query_rsSearch = sprintf("SELECT * FROM EmployeeStore WHERE
    ItemName
    LIKE %s", GetSQLValueString("%" . $Search_rsSearch . "%",
    "text"));
    David Powers
    Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    http://foundationphp.com/

  • HT1212 ipod touch disabled due to too many incorrect password attempts - problem is I know the password

    My daughter's ipod touch is locked due to too many incorrect password attempts (thanks to her little brother).  It is displaying the red bar that states ipod is disabled connect to itunes.  Problem is we don't have the computer that the ipod was originally synced with and she doesn't want to reset the ipod.  In this instance we know the password.. so is there anyway to get the ipod to ask us one more time to enter the password?  I'm not sure how many incorrect attempts were made, but it doesn't state anything about try again in so many minutes.. help, please!

    No. Start with the last paragraph of:
    Disabled
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Forgot passcode or device disabled
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:                                                             
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: Back up and restore your iOS device with iCloud or iTunes       
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode.
    If you previously synced to the computer then you may be able to recover use of the iPod without erasing the iPod by following the instructions here:
    Disabled Recovery-must use syncing computer.

  • Quote problem in Generating Insert Statement Script to Extract Data

    Hi every body;
    I would like to write an sql/plsql script which can extract data from an oracle existing table in insert statements.
    example:
    the table employees:
    empno name
    1 john
    2 M'hir
    3 M'silou
    My problem is that i have the following result:
    insert into employees values('1','john');
    insert into employees values('2','m'hir');------- Problem with M'hir qote
    insert into employees values('3','M'silou');----- Problem with M'silou quote
    How can i have :
    insert into employees values('2','m''hir');------- two quotes with M'hir =M''hir
    insert into employees values('3','M''silou');----- Problem with M'silou=M''silou
    plz your help
    thank you at advance

    Hi,
    What is your DB version?? If it is >10g, you can use the Q delimiter (as mentioned by Solomon).
    Check this out.
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_sqltypes.htm#BABFEDBG
    -Arun

  • HT201401 I need to restore my iPhone. When I connect to my pc in iTunes it asks me to unlock the phone using my password.  Problem is that I can't get to the password lock screen to do so. I can only get either the iTunes screen or the Emergency Call scre

    I need to restore my iPhone.  Once in iTunes, I get an error message asking me to use my passowrd to unlock phone. The problem is that I can't get to the password lock screen. All I can get is the iTunes screen or the emergency call only screen.

    yes did you buy it of somebody or a well known company such as apple or carphone warehouse?
    and i mean the phone would have been activated in the first place with the sim card you get given when you first get the phone.
    trying to activate the phone with another sim card that you did not get when you brought the phone may result in you not being able to activate it
    no worries

  • Getting My Password Reset Problems:

    I tried to reset my security questions by clicking the button that makes apple send you an email with a link to reset your password. Yet I've never got it, its been a week that I've had this problem! please help!
    Twitter @SnowHeroHD
    Any help would be much appriciated here or on twitter,
    thanks in advance.

    (This is for itunes, I'm simply using a new device so its asking for all this)

  • Fine-Grained Password Policy problem

    Hi All,
    I'm testing a Fine-Grained Password Policy for a group of users.
    I created a test PSO using ASDI Edit and applied the PSO to a global security group.
    Test user has been added to this group.
    The PSO settings include "Enforce password history: 5"
    The user has changed the password.
    After 24h when I logged in as the user and changed the password - for example: Password1.
    After another 24 hours I changed the password to Password2.
    One day later I've been asked to change the password again.
    In theory I shouldn't be able to use any of the 5 previous passwords (password history = 5) but when I entered Password1 it was accepted.
    Do you know where can be the problem ?
    System info: Windows Server 2008 R2 (forest/domain level is also 2008)
    Regards,
    Marcin

    This is very interesting. I don't have any lab to repro though... So I can't look at it closer.
    From an LDAP perspective, when you change your password on AD, you have to comply with the password history policy. This requirement is send by the server to the client thanks to the supported control: LDAP_SERVER_POLICY_HINTS_OID that you can see just by
    looking at the RootDSE of one of your DC (http://msdn.microsoft.com/en-us/library/cc223320.aspx Used with an LDAP operation to enforce password history policies during password set). I am
    aware of issues with AD-LDS not honoring it, but not AD... I am not sure if the situation described with FIM here matches your issue:
    http://support.microsoft.com/kb/2443871 in this article:
    "The "Enforce password history" and "Minimum password age" Group Policy settings do not work when you reset the password for a Windows Server 2008 R2-based or a Windows Server 2008-based computer."
    But it would mean that it also affects users not having a FGGP (because this isn't specific to FGGP), ad the minimum password age as well. If you have a chance to try this in a lab, let us now... In the mean time, if you can share logs or code from your
    app? Like the section that does the password change?
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Maybe you are looking for