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

[Sécurité - Audit] Absence de restriction CORS #3640

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

sfinx13
Copy link
Collaborator

@sfinx13 sfinx13 commented Jan 30, 2025

Ticket

#3563

Description

image

Changements apportés

  • Suppression de la conf nginx pour empecher les appels ajax cross domain (comportement par défaut)

Pré-requis

make build

Créer ce fichier et exécuter le sur un autre port (Utilisation du serveur interne vscode port : 5500)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Cors test</title>
</head>
<body>
    <p>Cors test</p>
    <script>
        fetch('http://localhost:8080/statistiques-filter?territoire=all', {
            method: 'GET',
          })
        .then(response => {
            if (!response.ok) {
                throw new Error(`Erreur HTTP : ${response.status}`);
            }
                return response.json();
            })
        .then(data => console.log('Réponse OK:', data))
        .catch(error => console.error('Erreur CORS:', error));
          
    </script>
</body>
</html>

Tests

  • Exécuter le script ajax sur un serveur différent et vérifier que l'appel est bloqué par la plateforme comme sur la copie d'écran.

@sfinx13 sfinx13 force-pushed the feature/3563-handle-cors branch from f8e53d6 to 5187c4c Compare January 30, 2025 09:43
@sfinx13 sfinx13 force-pushed the feature/3563-handle-cors branch from 6cbf7d6 to c398909 Compare February 3, 2025 10:23
Copy link

sonarqubecloud bot commented Feb 3, 2025

Copy link
Collaborator

@numew numew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@numew numew merged commit 439c9c2 into develop Feb 3, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants