今日を知り、明日を変えるシステム運用メディア

AWS Amplify はサーバーレンダリングされた Next.js アプリケーションの HttpOnly Cookie をサポートします

AWS Amplify はサーバーレンダリングされた Next.js アプリケーションの HttpOnly Cookie をサポートします

本記事は、2025 年 3 月 3 日にAWS公式サイトの What’s New with AWS? に掲載された英語記事を自動翻訳したものです。

ニュース内容

AWS Amplify は、Amazon Cognito のマネージドログインを使用する場合、サーバーレンダリングされた Next.js アプリケーションで HttpOnly Cookie をサポートするようになりました。この機能強化は、サーバーレンダリングされたサイトの既存の Cookie 機能に基づいており、HttpOnly 属性をオプトインすると、クライアント側の JavaScript が Cookie コンテンツにアクセスするのをブロックすることで、アプリケーションのセキュリティ体制が強化されます。

HttpOnly Cookie を使用すると、アプリケーションはクロスサイトスクリプティング (XSS) 攻撃に対する追加の保護レイヤーを獲得できます。これにより、機密情報が安全に保たれ、ブラウザとサーバーの間でのみ送信されるようになります。これは、Web アプリケーションで認証トークンを処理する場合に特に役立ちます。HttpOnly 属性を持つ Cookie のコンテンツはサーバーによってのみ読み取ることができるため、リクエストは他のサービスに到達する前にサーバーを通過する必要があります。

この機能は、AWS Amplify と Amazon Cognito がサポートされているすべての AWS リージョンで利用できるようになりました。

詳細については、サーバー側レンダリングに関する AWS Amplify ドキュメントをご覧ください。

原文

AWS Amplify now supports HttpOnly cookies for server-rendered Next.js applications when using Amazon Cognito’s Managed Login. This enhancement builds upon existing cookie functionality in server-rendered sites, opting in to the HttpOnly attribute strengthens your application’s security posture by blocking client-side JavaScript from accessing cookie contents.

With HttpOnly cookies, your applications gain an additional layer of protection against cross-site scripting (XSS) attacks. This ensures that sensitive information remains secure and will only be transmitted between the browser and the server, and is particularly valuable when handling authentication tokens in your web applications. The contents of cookies with HttpOnly attributes can only be read by the server, requiring your requests to flow through the server before reaching other services.

This feature is now available in all AWS regions where AWS Amplify and Amazon Cognito are supported.

To learn more, visit the AWS Amplify documentation for Server-Side Rendering.

引用元:AWS Amplify supports HttpOnly cookies for server-rendered Next.js applications

人気の記事

最新情報をお届けします!

最新のITトレンドやセキュリティ対策の情報を、メルマガでいち早く受け取りませんか?ぜひご登録ください

メルマガ登録