-
Notifications
You must be signed in to change notification settings - Fork 1
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
Prefix constant string to M' and add statement about attack detection #86
Comments
Alternatively, since RSA and ECDSA actually sign a hash, and everything else relevant has context inputs, one could do something like the follows to get actual strong non-separability (even for RSA and ECDSA): Pure:
Prehashed:
RSA:
ECDSA:
Ed25519:
Ed448:
ML-DSA:
Some notes:
|
Falko, the current version of composite signatures all use DER Encoded OIDs that start with HEX 060B6086480186FA6B50080 which could be considered the magic String you are talking about. So we think this already meets the requirement you are asking about. We acknowledge that the current OIDs will change, and will be assigned by IANA so it is likely they will become shorter. For example in the IANA registry, it would be something like 1.2.840.113549.1.9.16.3.xx (where xx is the composite algorithms). So 1.2.840.113549.1.9.16.3 can be considered the MAGIC string (DER encoded of course). See https://www.iana.org/assignments/smi-numbers/smi-numbers.xhtml#security-smime-3 . Does this satisfy your concern? |
@falko-strenzke I do not understand this sentence:
This magic prefix that you are talking about is only added by the construction of @ilaril we have considered this. Thank you for writing out what this would look like. We decided against using the EdDSA ctx because many crypto libraries do not support this, and one of the design goals is to be able to use your existing (potentially certified / change-controlled) legacy crypto code as-is without modification. See #64 We could add a wrapper to RSA and ECDSA as you suggest to bind a ctx, but since we are already adding |
Here the case of a stripping attack is relevant where the attacker removes the PQ signatures and leaves the traditional signature and changes the message to M'. The signature is then valid for M'. If M' starts with the magic sequence, that can be detected by the verifier. |
I don't think it does because |
This comment makes no sense to me. The verifier takes as input Then the verifier itself constructs |
Ok. Thanks Falko. In regards to your comments: M' = prefix || Domain || ctx.length || ctx || M b) I'm not sure I understand. You mention using a magic constant, so where does the randomness come into play? If we used a random prefix, it would have to be stored as part of the signature itself so it could be verified. c) Yes, I agree, different OIDs with a different prefix could be registered in the future. So having a prefix of specific length would prevent this. So I think I agree that a prefix at least guarantees a constant value that is of a specific length (you say 16 - 32 bytes) which I guess is 128 bits to 256 bits. The only remaining question is why do we need this property? Can you give a detailed example to help us understand please? |
I wrote "... and changes the message to |
Hi Falko, I think the confusion is because you mention M' . In Composite M' is defined as the message format of the Composite. M' = Domain || len(ctx) || ctx || M It seems you are using M' to mean something slightly different. I've re-read you comment multiple times and am still trying to figure out what you mean. "Here the case of a stripping attack is relevant where the attacker removes the PQ signatures and leaves the traditional signature and changes the message to M'. The signature is then valid for M'. If M' starts with the magic sequence, that can be detected by the verifier.: So I'm trying to follow what you are saying.. You say the attacker removes the PQ signatures and leaves the traditional signature. So I think you mean: instead of: PQ is stripped out and we just have the following traditional component: So I think you are saying a regular traditional verifier would verify the stripped traditional signature by having an attacker compute M' (from M) and handing the traditional stripped signature and the constructed message: The same thing could NOT be done with the ML-DSA PQ component because of the context. "If M' starts with the magic sequence, that can be detected by the verifier"
So please help me understand if I'm on the right track, or give us a more detailed explanation of how this works. I am obviously missing something important that isn't obvious to me. |
No, the
Yes, that is the attack I am referring to.
Yes, the attacker replaces
Exactly.
Exaclty, the implementation of the verifier would have to be updated to know the magic sequence and classify a message starting with it as an attack message.
For the verifier of a composite signature, in principle the inverse attack was possible: The attacker lets the signer sign two messages |
Thanks for the update Falco! Now we have the same understanding. So you want us to add the prefix to help mitigate a stripping attacked that will require an update to the classical verifier to do this detection. We would do this for all composite signature combinations (as well as any future combinations). So if we add this: M' = prefix || Domain || len(ctx) || ctx || M where: As well as a couple sentences explaining why this has been added, I believe it will mitigate the issue and make you happy. |
I am basically OK with this solution. The prefix string has sufficient entropy. To achieve even some degree of protocol domain separation, we could make the prefix "IetfCmsCompositeAlgorithmSignatures2025". In my view, there is no need for an obligation to apply the detection of this prefix in a verified message (this cannot be enforced for existing implementations anyway), but should be presented as an optional measure to prevent the theoretical forgeries. So in my view the draft should incorporate a sentence mentioning the possibility of the attack detection via prefix detection.
Yes, a short discussion of the principal forgery attacks and the role of the prefix detection (for instance in the security considerations section) would be good. |
First attempt at adding the Prefix for #86
Added prefix into the draft and added a note about it in the security considerations section |
In the current proposal M' is starting with the OID. My suggestion is to prefix a "magic" constant of length of 16 or 32 bytes to the OID.
The reason is the following: In the case that a signature stripping attack is executed where the PQ signature is stipped of, the reamaining traditional signature is valid for the message M'. This amounts to a EUF-CMA violation (under consideration of cross-algorithm chosen message oracle queries).
Prefixing the magic constant allows CMS implementations of the signature verification to perform attack detection by checking the start of the signed data to be equal to the magic string. Otherwise, the forged message cannot be detected and may cause harm in the receiving system.
The value of the attack detection mechanism should be mentioned in the text as well. In my view, it should be specified as a "SHOULD" feature.
The text was updated successfully, but these errors were encountered: