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

Secret header is set twice in the request from Solr to Alresco repository (X-Alfresco-Search-Secret) #2484

Open
Vincent-hubgit opened this issue Mar 3, 2024 · 2 comments

Comments

@Vincent-hubgit
Copy link

Hi,

I've installed Alfresco 7.2 with ansible (installer v2.0)
Communications between Alfresco and Solr were configured to use "secret"
Everything was working fine but then I added an apache proxy between Solr and Alfresco : solr started to throw 403 errors

After some investigations, I've discovered that the X-Alfresco-Search-Secret header is set twice in the request from solr to Alfresco.
This is not an issue on its own as it's allowed by http protocole but that should be corrected

In Apache proxy (and in other proxies too I believe), when a header is set twice, they are concatened in the response (or in the forwarded request to the backend).

So basically :

X-Alfresco-Search-Secret:MWSd8bhEtfgYidx_Jn6t
X-Alfresco-Search-Secret:MWSd8bhEtfgYidx_Jn6t

become :

X-Alfresco-Search-Secret:MWSd8bhEtfgYidx_Jn6t, MWSd8bhEtfgYidx_Jn6t

And then Alfresco is unable to interpret it correctly (I believe is taking the entire value as the secret)

@Vincent-hubgit
Copy link
Author

@Vincent-hubgit
Copy link
Author

For those who might encounter the same issue, I've used this workaround in Apache config for the <Location /alfresco> :

SetEnvIf X-Alfresco-Search-Secret ([^,\s]+) ALFRESCO_SECRET=$1
RequestHeader set X-Alfresco-Search-Secret "%{ALFRESCO_SECRET}e"

So only the first occurence of X-Alfresco-Search-Secret is transmitted to Alfresco
If Alfresco fix the issue in a future release, that will still work with a unique secret header

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

1 participant