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

Content Security Policy (CSP) #1122

Open
likehopper opened this issue Feb 23, 2021 · 4 comments · May be fixed by #1580
Open

Content Security Policy (CSP) #1122

likehopper opened this issue Feb 23, 2021 · 4 comments · May be fixed by #1580

Comments

@likehopper
Copy link

The security requirements of web servers are increasing. From now it's recommended to have a "Content-Security-Policy" rule. And generally, it prohibits the execution of inline scripts (unsafe-inline).

However, in Sympa's pages, we have an innline script generated dynamically. And that prevents the menu from working.

For example these include:

        <!-- head_javascript.tt2 -->

	<script>
	<!--
	var sympa = {
	    backText:           'Retour',
	    calendarButtonText: 'Calendrier',
	    calendarFirstDay:   0,
	    closeText:          'Fermer',
	    dayNames:           'Lundi:Mardi:Mercredi:Jeudi:Vendredi:Samedi:Dimanche'.split(":"),
	    dayNamesMin:        'D:L:M:M:J:V:S'.split(":"),
	    home_url:           '/sympa/',
	    icon	s_url:          '/static-sympa/icons',
	    lang:               'fr',
	    loadingText:        'Veuillez patienter...',
	    monthNamesShort:    'Jan:Fév:Mar:Avr:Mai:Jui:Juil:Aoû:Sep:Oct:Nov:Déc'.split(":"),
	    openInNewWinText:   'Ouvrir dans une nouvelle fenêtre',
	    resetText:          'Effacer'
	};
	var lang = 'fr';
	//-->
	</script>

Could you change it to call it from an external file?

Thanks,
Vincent

@ikedas
Copy link
Member

ikedas commented Feb 24, 2021

There seem some more things to be prohibited by CSP:

  • "onclick" event handler in HTML: compose_mail.tt2, request_topic.tt2 and viewmod.tt2.
  • inline javascript for email obfuscation generated by setting spam_protection and/or web_archive_spam_protection parameter as javascript.

@likehopper
Copy link
Author

Has the code been updated ?

@ikedas
Copy link
Member

ikedas commented Nov 24, 2022

How can we resolve the points I mentioned?

@ikedas
Copy link
Member

ikedas commented Jan 18, 2023

Hi @likehopper ,
Could you please apply the changes in PR above and check if the problem will be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants