The Soviet attack on Poland was the implementation of the treaty signed in Moscow on August 23, 1939, by the Minister of Foreign Affairs of the Third Reich, Joachim von Ribbentrop, and the People's Commissar for Foreign Affairs of the USSR, Vyacheslav Molotov, who was also chairman of the Council of People's Commissars (Prime Minister).
An integral part of the then Soviet-German non-aggression pact was the secret additional protocol. Its second point, directly concerning Poland, reads as follows: "In the case of territorial and political transformations in the territories belonging to the Polish State, the border between the zones of interest of Germany and the USSR will run approximately along the line of the Narew, Vistula and San rivers. The question of whether it would be in the mutual interest to maintain an independent Polish state and what the borders of that state will be can only be finally clarified in the course of further political events. In any case, both governments will settle this issue in a friendly agreement".
Information about the said secret protocol did not reach Poland, even though the Allied leaders knew about it.
Source: Poland Daily 24, niezalezna.pl, pap.pl