-
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
Problem: It is possible to create invalid pointer files relatively easily as they use restricted character sets for transfer/package IDs #380
Comments
This issue impacts: https://github.com/artefactual/archivematica/issues/1129 |
This issue might also impact the approach to: artefactual/archivematica-storage-service#324 |
See proposed fix for #660. |
Closing in favor of #660. The fix there does resolve this, What I missed in my analysis above is that between the beginning of the transfer and the end of the transfer, the transfer name is 'cleaned up'. So many of these characters will be removed making it okay to wrap the transfer name in the METS file. |
Expected behaviour
It shouldn't be possible to create invalid pointer files.
Current behaviour
It is possible to create invalid pointer files. Invalid pointer files do not result in a failure in
1.7.x
or1.8.x
because the result of the validation does not get returned to the MCP Server.The affected fields are
mets:file ID
andmets:fptr FILEID
and both of these have very specific data types that are required to validate against thexs:NCName
type.There is a good discussion about how restrictive NCName fields are here: https://stackoverflow.com/questions/1631396/what-is-an-xsncname-type-and-when-should-it-be-used
I have completed a worked example/demo below.
If a user inputs a value into the transfer name that is not a valid
xs:NCName
the pointer file will be created invalid.Steps to reproduce
Create a transfer with the transfer name
34750.zip
(the package must be set to be compressed) and monitor the storage service logs. The output will be as follows:This can be seen when run against
xmllint
as well nb. investigation needs to be done into the other errors:Your environment (version of Archivematica, OS version, etc)
Archivematica
1.7
andqa/1.x
Worked example
The following example demonstrates valid and invalid combinations that can be used in the transfer name field. I demonstrate this using the xs:types from the pointer file (
xs:ID
,xs:IDREF
), and the globalxs:NCName
type which they both inherit. It is possible to see their equivalence this way. For each test I usexmllint
. The templates below might be useful for understanding how restrictive this field is, how we may either validate, restrict, or modify the data input in the the transfer name field.XML:
XSD:
Output:
For Artefactual use:
Please make sure these steps are taken before moving this issue from Review to Verified in Waffle:
The text was updated successfully, but these errors were encountered: